HELP: Change the sampling time in gprof

perugupa@csee.wvu.edu perugupa@csee.wvu.edu
Wed May 26 17:46:00 GMT 2004


Hi Nick,
       thanks for the reply.

>You did not specify your host environment

I am working on debian linux 2.4.24-1-smp kernal

> So your choices are:
>
>   1. Alter the profil() function in your OS.
>   2. Write your own monstartup() function and find some other way of
> generating the time samples.
>   3. Use a different profiler which may be more suitable

I may not be able to chage the profiler at this stage, so I will go for
the first option. can you tell me how to change the profil() function.is
this the function i have to change in this environment or is there some
thing else i should take care of.thanx in advance
regards,
Ranganath.




> Hi Ranganath,
>
>>    I am new to this group.I have a problem with gprof.I dont know if
>>    this is the right place to ask this question.
>
> It is the right place.
>
>>    i am extracting the execution profiles of the test cases on gcc
>>    sing
>> gprof.the output of the profile has all 0's for the self seconds
>> colomn.is there any way to change the sample time so that i can get
>> reasonable numbers in the colomn.default is 0.01 sec.i would like to
>> change that to 0.001 or even lower...
>
> Unfortunately the sampling rate is not controlled gprof itself.
> Instead  it is handled by the special function monstartup() which is
> called by a  profiled program when it starts up.  On most systems this
> function will  use the OS function profil() to set up the time-based
> sampling.
>
> So your choices are:
>
>   1. Alter the profil() function in your OS.
>   2. Write your own monstartup() function and find some other way of
> generating the time samples.
>   3. Use a different profiler which may be more suitable.  You did not
> specify your host environment so I cannot be more informative, but you
> should check out the oprofile project which might be what you need:
>
> http://oprofile.sourceforge.net/about/
>
> Cheers
>   Nick





More information about the Binutils mailing list