Thursday, November 8, 2007

Profiling with gprof

  1. Compile with -pg option
  2. Link with -pg and -g options
  3. Run the program as usual. The binary gmon.out file will be generated.
  4. To analyse the results run gprof
    $ gprof program-name [ data-file ] [ > output-file ]
If you don't specify the name of a data file, gmon.out is assumed.


TODO:
Check kprof and xprofiler!

1 comment:

Anonymous said...

Interesting to know.