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]

gprof - reg


Hi all,

I am currently working on gprof utility. I need a clarification on the following. 

To determine the execution time of a function, gprof uses sampling method by collecting samples of program counter at regular intervals of time. It provides a statistical approximation of execution time.  

Other method is to measure the lapsed time between function entry and function exit. This method is simple and will provide exact timings. 

Why the first method is used in spite of its overhead? why the second method is not adopted for evaluating function execution time? What are the advantages of using the first method over the second?

Pls do respond, Thanks in advance.


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