User forums > Help

Please help to solve the 'Code Profiler' problem on Linux x86_64 system.

<< < (2/3) > >>

oBFusCATed:
Jens, probably you should add a check at line 108, too...

Jenna:

--- Quote from: oBFusCATed on April 01, 2011, 01:49:43 am ---Jens, probably you should add a check at line 108, too...

--- End quote ---
I don't think it's needed, because count is initialized with zero and can not be out of boundary here (we check for empty arrays in line 99).

wangdong1226:
Dear Jens,

Thank you for your effort. CodeBlocks-svn7075 has solved the crash problem when using code profiler in C language.

But, there a little bit strange:
When I using Code Profiler in C language, every time when I tried different .c file, and each time I build it and run it, but I got an empty output all the same.   :shock:

for example:


----------------
Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ts/call  Ts/call  name   

 %         the percentage of the total running time of the
time       program used by this function.

cumulative a running sum of the number of seconds accounted
 seconds   for by this function and those listed above it.

 self      the number of seconds accounted for by this
seconds    function alone.  This is the major sort for this
           listing.

calls      the number of times this function was invoked, if
           this function is profiled, else blank.
 
 self      the average number of milliseconds spent in this
ms/call    function per call, if this function is profiled,
      else blank.

 total     the average number of milliseconds spent in this
ms/call    function and its descendents per call, if this
      function is profiled, else blank.

name       the name of the function.  This is the minor sort
           for this listing. The index shows the location of
      the function in the gprof listing. If the index is
      in parenthesis it shows where it would appear in
      the gprof listing if it were to be printed.
----------------

Am I wrong somewhere?


Best regards.
David.

Jenna:
No, you are not wrong, but that was the cause for the crash.

If you try gprof from console with a simple wizard-create hello world project it is in fact empty:


--- Code: ---jens@debian-inspiron:/tmp/testc$ gprof bin/Debug/testc gmon.out
Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total          
 time   seconds   seconds    calls  Ts/call  Ts/call  name    

 %         the percentage of the total running time of the
time       program used by this function.

cumulative a running sum of the number of seconds accounted
 seconds   for by this function and those listed above it.

 self      the number of seconds accounted for by this
seconds    function alone.  This is the major sort for this
           listing.

calls      the number of times this function was invoked, if
           this function is profiled, else blank.
 
 self      the average number of milliseconds spent in this
ms/call    function per call, if this function is profiled,
  else blank.

 total     the average number of milliseconds spent in this
ms/call    function and its descendents per call, if this
  function is profiled, else blank.

name       the name of the function.  This is the minor sort
           for this listing. The index shows the location of
  the function in the gprof listing. If the index is
  in parenthesis it shows where it would appear in
  the gprof listing if it were to be printed.

--- End code ---

But if you add a simple call to a function of your own, you get some output.
Maybe the C-libraries of debian (and ubuntu/mint) are not build with -pg flag set.

By the way: please use code-tags if you paste sources or console output, it's much better readable.

oBFusCATed:
wangdong1226:
Keep in mind that gprof works only for CPU intensive profiling and doesn't work with static libraries.
If you have blocking syscalls, sleeps or something like this, gprof won't be usable.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version