Page 1 of 1

Profilling with CL and g++

Posted: Mon Aug 13, 2012 2:50 pm
by evstevemd
Hi,
Its long time now I use CL and I'm quiet happy with it. Great product!
Now I have problem in profiling my code (I want to check functions that a time consuming and optimize code). After search I found that gprof and callgrind are valid options. Now I tried callgrind and I wanted to check out gprof. Looking at g++ manual I need to add -pg flag and so I did select in CL project and in compiling and linking CL logs that the flag is indeed included. but running CL does not output profile file. Is there any setting that I miss? any advice?

CL SVN (4.0.5646)
wxWidgets 2.9 (codelite is compiled against 2.8)
Ubuntu 12.04
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

Thanks In advance

Re: Profilling with CL and g++

Posted: Mon Aug 13, 2012 3:02 pm
by jfouche
Hi,
You may want to try the new callgraph plugin...

Re: Profilling with CL and g++

Posted: Mon Aug 13, 2012 3:21 pm
by evstevemd
jfouche wrote:Hi,
You may want to try the new callgraph plugin...
Hi Jeremie,
I hope you do fine :)
I have the plugin but I thought it needs the same file which my CL built app does not generate. Do I miss something here?

Re: Profilling with CL and g++

Posted: Mon Aug 13, 2012 7:20 pm
by Jarod42
Have you checked into Working directory set by the project, and near the executable.

Are you sure you have -pg in compiler options AND linker options ?
(Note also the compiler option -g (to have debug info) is useful ;)
and make sure that linker option -s (strip symbol) is not present)

It works fine here.

Re: Profilling with CL and g++

Posted: Mon Aug 13, 2012 10:44 pm
by evstevemd
Jarod42 wrote:Have you checked into Working directory set by the project, and near the executable.

Are you sure you have -pg in compiler options AND linker options ?
(Note also the compiler option -g (to have debug info) is useful ;)
and make sure that linker option -s (strip symbol) is not present)

It works fine here.
Let me check what is CWD. So far other options you mentioned looks fine!
Thanks!

Re: Profilling with CL and g++

Posted: Mon Aug 13, 2012 11:02 pm
by evstevemd
That is the problem. I can see it but then It cannot open it says
The CallGraph plugin has suggested node threshold 1 to speed-up the call graph creation. You can alter it on the call graph panel.
clicking ok gives
Failed to open file CallGraph.png. Please check the project settings, rebuild the project and try again.
Don't know what is wrong but trying to figure out!

Re: Profilling with CL and g++

Posted: Mon Aug 13, 2012 11:52 pm
by jfouche
Hi Steve,

Do you have dot in the path ? I suppose it's needed by this plugin...

Re: Profilling with CL and g++

Posted: Sat Sep 01, 2012 2:42 pm
by evstevemd
jfouche wrote:Hi Steve,

Do you have dot in the path ? I suppose it's needed by this plugin...
Sorry for late reply but yet here is what commend dot -v gives from terminal

Code: Select all

dot -v
dot - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.so.6
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
	/usr/lib/graphviz/config6
		was successfully loaded.
    render	:  cairo dot fig gd map ps svg tk vml vrml xdot
    layout	:  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout	:  textlayout
    device	:  canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xlib
    loadimage	:  (lib) eps gd gd2 gif jpe jpeg jpg png ps svg