This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: HELP: Change the sampling time in gprof


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]