[lug] Program timing

Ted Logan ted.logan at gmail.com
Tue Sep 9 08:45:01 MDT 2008


On Tue, Sep 9, 2008 at 8:12 AM, Stephen Queen <svqueen at gmail.com> wrote:
> I'm sure I've seen this discussed on this list before, I just don't
> seem to be able to find it in the archives.
> I'm looking for a program that can display the timing of various
> functions in a user space program. Does anyone have a recommendation
> or suggestion?

The most comprehensive solution is profiling. The standard Linux
utility is gprof:

http://sourceware.org/binutils/docs/gprof/index.html

You'll need to recompile your code with profiling enabled, then run
the program and run gprof on the profiling log file.

-- 
Ted Logan
ted.logan at gmail.com
http://jaeger.festing.org/



More information about the LUG mailing list