gprof and binutils

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

gprof and binutils

jayshankar nair
Hi,

gprof  (Bin utils 2.20) reports the %Time as 0.0  for source code profiling. I
was wondering where i can download the correct binutils binaries with the gprof
fixes. Please let me know.

Thanks,
Jay


Sample Output:


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
  0.00      0.00     0.00                             AddAtomA@4
  0.00      0.00     0.00                             AddNumbers
  
  0.00      0.00     0.00                             ExitProcess@4
  0.00      0.00     0.00                             FindAtomA@4
  0.00      0.00     0.00                             GetAtomNameA@12
  0.00      0.00     0.00                             SetUnhandledExceptionFilte


     


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: gprof and binutils

Dongsheng Song
Maybe this is a system clock resolution issue.

Please check your clock resolution like this:

http://live.sysinternals.com/Clockres.exe

C:\var\download>clockres

ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 15.625 ms
Minimum timer interval: 1.000 ms
Current timer interval: 0.977 ms

<span class="286-1-4" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;286-1-4&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;286-1-4&#39;, false, true);" title="点击获取释义">As far as <span class="286-2-4" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;286-2-4&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;286-2-4&#39;, false, true);" title="点击获取释义">I <span class="286-3-4" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;286-3-4&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;286-3-4&#39;, false, true);" title="点击获取释义">know, profile v<span class="154-5-3" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;154-5-3&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;154-5-3&#39;, false, true);" title="点击获取释义">ery <span class="154-6-3" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;154-6-3&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;154-6-3&#39;, false, true);" title="点击获取释义">short <span class="154-7-3" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;154-7-3&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;154-7-3&#39;, false, true);" title="点击获取释义">running time<span class="154-10-3" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;154-10-3&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;154-10-3&#39;, false, true);" title="点击获取释义"> is meaningless for gprof.
<span class="41-3-1" style="cursor: pointer;" onclick="Lingo.processQuery(JAM.UI.getElText(this)); return false;" onmouseover="Lingo.AlignMan.stopAnimation(); Lingo.AlignMan.alignWords(&#39;41-3-1&#39;, true);" onmouseout="Lingo.AlignMan.alignWords(&#39;41-3-1&#39;, false, true);" title="点击获取释义">
On Mon, Jul 19, 2010 at 02:22, jayshankar nair <[hidden email]> wrote:
Hi,

gprof  (Bin utils 2.20) reports the %Time as 0.0  for source code profiling. I
was wondering where i can download the correct binutils binaries with the gprof
fixes. Please let me know.

Thanks,
Jay


Sample Output:


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
  0.00      0.00     0.00                             AddAtomA@4
  0.00      0.00     0.00                             AddNumbers
  
  0.00      0.00     0.00                             ExitProcess@4
  0.00      0.00     0.00                             FindAtomA@4
  0.00      0.00     0.00                             GetAtomNameA@12
  0.00      0.00     0.00                             SetUnhandledExceptionFilte


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: gprof and binutils

Dongsheng Song
PS:
If your source code only in main, then gprof does not out put anything of your code.
For example, the following code:

#include <stdio.h>
#include <stdlib.h>
int main()
{
  int i;
  for(i = 0; i < 1000000; i ++)
    strtod("0.123", NULL);
  return 0;
}

Profile out put like this (no main function):

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
 20.48      0.17     0.17                             __strtodg
 15.66      0.30     0.13                             dtoa_unlock
 14.46      0.42     0.12                             dtoa_lock
  9.64      0.50     0.08                             __lshift_D2A
  7.23      0.56     0.06                             __Balloc_D2A
  7.23      0.62     0.06                             __Bfree_D2A
  6.02      0.67     0.05                             __d2b_D2A
  6.02      0.72     0.05                             __diff_D2A
  6.02      0.77     0.05                             __strtod
  2.41      0.79     0.02                             __cmp_D2A
  1.20      0.80     0.01                             __mult_D2A
  1.20      0.81     0.01                             __multadd_D2A
  1.20      0.82     0.01                             __pow5mult_D2A
  1.20      0.83     0.01                             rvOK

But the following code:

#include <stdio.h>
#include <stdlib.h>

void test()
{
  int i;
  for(i = 0; i < 1000000; i ++)
    strtod("0.123", NULL);
}

int main()
{
  test();
  return 0;
}


have useful out put like this (have test function):

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
 19.48      0.15     0.15                             __strtodg
 18.18      0.29     0.14                             dtoa_unlock
 11.69      0.38     0.09                             dtoa_lock
  9.09      0.45     0.07                             __Bfree_D2A
  7.79      0.51     0.06                             __copybits_D2A
  5.19      0.55     0.04                             __cmp_D2A
  5.19      0.59     0.04                             __strtod
  3.90      0.62     0.03                             __Balloc_D2A
  3.90      0.65     0.03                             __d2b_D2A
  3.90      0.68     0.03                             __diff_D2A
  3.90      0.71     0.03                             __multadd_D2A
  2.60      0.73     0.02                             __lshift_D2A
  2.60      0.75     0.02                             __s2b_D2A
  1.30      0.76     0.01                             __mult_D2A
  1.30      0.77     0.01                             rvOK
  0.00      0.77     0.00        1     0.00     0.00  test

On Mon, Jul 19, 2010 at 10:51, Dongsheng Song <[hidden email]> wrote:
Maybe this is a system clock resolution issue.

Please check your clock resolution like this:

http://live.sysinternals.com/Clockres.exe

C:\var\download>clockres

ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 15.625 ms
Minimum timer interval: 1.000 ms
Current timer interval: 0.977 ms

As far as I know, profile very short running time is meaningless for gprof.

On Mon, Jul 19, 2010 at 02:22, jayshankar nair <[hidden email]> wrote:
Hi,

gprof  (Bin utils 2.20) reports the %Time as 0.0  for source code profiling. I
was wondering where i can download the correct binutils binaries with the gprof
fixes. Please let me know.

Thanks,
Jay


Sample Output:


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
  0.00      0.00     0.00                             AddAtomA@4
  0.00      0.00     0.00                             AddNumbers
  
  0.00      0.00     0.00                             ExitProcess@4
  0.00      0.00     0.00                             FindAtomA@4
  0.00      0.00     0.00                             GetAtomNameA@12
  0.00      0.00     0.00                             SetUnhandledExceptionFilte



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: gprof and binutils

Kai Tietz-2
2010/7/19 Dongsheng Song <[hidden email]>:

> PS:
> If your source code only in main, then gprof does not out put anything of
> your code.
> For example, the following code:
>
> #include <stdio.h>
> #include <stdlib.h>
> int main()
> {
>   int i;
>   for(i = 0; i < 1000000; i ++)
>     strtod("0.123", NULL);
>   return 0;
> }
>
> Profile out put like this (no main function):
>
> Each sample counts as 0.01 seconds.
>   %   cumulative   self              self     total
>  time   seconds   seconds    calls  Ts/call  Ts/call  name
>  20.48      0.17     0.17                             __strtodg
>  15.66      0.30     0.13                             dtoa_unlock
>  14.46      0.42     0.12                             dtoa_lock
>   9.64      0.50     0.08                             __lshift_D2A
>   7.23      0.56     0.06                             __Balloc_D2A
>   7.23      0.62     0.06                             __Bfree_D2A
>   6.02      0.67     0.05                             __d2b_D2A
>   6.02      0.72     0.05                             __diff_D2A
>   6.02      0.77     0.05                             __strtod
>   2.41      0.79     0.02                             __cmp_D2A
>   1.20      0.80     0.01                             __mult_D2A
>   1.20      0.81     0.01                             __multadd_D2A
>   1.20      0.82     0.01                             __pow5mult_D2A
>   1.20      0.83     0.01                             rvOK
>
> But the following code:
>
> #include <stdio.h>
> #include <stdlib.h>
>
> void test()
> {
>   int i;
>   for(i = 0; i < 1000000; i ++)
>     strtod("0.123", NULL);
> }
>
> int main()
> {
>   test();
>   return 0;
> }
>
>
> have useful out put like this (have test function):
>
> Each sample counts as 0.01 seconds.
>   %   cumulative   self              self     total
>  time   seconds   seconds    calls  Ts/call  Ts/call  name
>  19.48      0.15     0.15                             __strtodg
>  18.18      0.29     0.14                             dtoa_unlock
>  11.69      0.38     0.09                             dtoa_lock
>   9.09      0.45     0.07                             __Bfree_D2A
>   7.79      0.51     0.06                             __copybits_D2A
>   5.19      0.55     0.04                             __cmp_D2A
>   5.19      0.59     0.04                             __strtod
>   3.90      0.62     0.03                             __Balloc_D2A
>   3.90      0.65     0.03                             __d2b_D2A
>   3.90      0.68     0.03                             __diff_D2A
>   3.90      0.71     0.03                             __multadd_D2A
>   2.60      0.73     0.02                             __lshift_D2A
>   2.60      0.75     0.02                             __s2b_D2A
>   1.30      0.76     0.01                             __mult_D2A
>   1.30      0.77     0.01                             rvOK
>   0.00      0.77     0.00        1     0.00     0.00  test
>
> On Mon, Jul 19, 2010 at 10:51, Dongsheng Song <[hidden email]>
> wrote:
>>
>> Maybe this is a system clock resolution issue.
>>
>> Please check your clock resolution like this:
>>
>> http://live.sysinternals.com/Clockres.exe
>>
>> C:\var\download>clockres
>>
>> ClockRes v2.0 - View the system clock resolution
>> Copyright (C) 2009 Mark Russinovich
>> SysInternals - www.sysinternals.com
>>
>> Maximum timer interval: 15.625 ms
>> Minimum timer interval: 1.000 ms
>> Current timer interval: 0.977 ms
>>
>> As far as I know, profile very short running time is meaningless for
>> gprof.
>>
>> On Mon, Jul 19, 2010 at 02:22, jayshankar nair <[hidden email]>
>> wrote:
>>>
>>> Hi,
>>>
>>> gprof  (Bin utils 2.20) reports the %Time as 0.0  for source code
>>> profiling. I
>>> was wondering where i can download the correct binutils binaries with the
>>> gprof
>>> fixes. Please let me know.
>>>
>>> Thanks,
>>> Jay
>>>
>>>
>>> Sample Output:
>>>
>>>
>>> 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
>>>   0.00      0.00     0.00                             AddAtomA@4
>>>   0.00      0.00     0.00                             AddNumbers
>>>
>>>   0.00      0.00     0.00                             ExitProcess@4
>>>   0.00      0.00     0.00                             FindAtomA@4
>>>   0.00      0.00     0.00                             GetAtomNameA@12
>>>   0.00      0.00     0.00
>>> SetUnhandledExceptionFilte
>>>
>
>

Hello,

That you don't see anything about main in profiling outputr can be
caused by the kind of emitting of _monstartup in main function. It
comes after the _mcount function call for main, so this mean profile
has no starting time-marker for the main-function.

Regards,
Kai

--
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users