gprof

Ken Raeburn raeburn@raeburn.org
Thu Sep 15 12:31:00 GMT 2005


On Sep 15, 2005, at 04:45, Michael Trimarchi wrote:
> Hi all,
> I'd like to profile multithread application using gprof, but I  
> cannot profile thread !!! why?
> Is the ITIMER signal problem?
> regards
> Michael

I've tried this before... yes, depending on the system, you may need  
to play some games after thread creation to start profiling in the  
newly created thread, such as explicitly scheduling an interrupt  
timer.  But also, if you care about the accuracy of the results, you  
may need to modify the C runtime support code for profiling, which  
typically updates the per-function data in a manner that is not  
thread-safe.

Unfortunately, I don't have any code to show you for either issue,  
right now...

Ken



More information about the Binutils mailing list