This is the mail archive of the binutils@sourceware.org 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: GProf's sampling inaccuracies


I'm profiling my C++ program and there are results that don't make a lot of
sense to me. It seems that some functions are taking much more time than they
look like they should. The best example is this one that does only one thing,
and that thing is an integer compare. Using different data, I can get the
flat profile to consistently report an average of about 275 self nanoseconds
per call. All that time just to compare two integers?

Use -pg only in the final link, so you don't get mcount() implanted into every function. You won't have a call count or a call graph, but you do get a much more accurate time profile in return.


Segher



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