How do we run the profiler

Where can I know the procedure to use the profiler.

Rajesh

From my recollection you need to do the following:
(steps may not be complete as this is from memory)

  • compile and link with the -p option.

  • will only write data on a regular exit of the program
    so if it doesn’t exit normally, I put in a signal handler
    that calls exit, and then slay the program with my signal.

  • then you should be able to run gprof gmon.out
    and get some stats.

The gnu online documentation has a manual for the use of profiling
that may help you.

Peter

Rajesh <varada_rajesh@yahoo.com> wrote:
: Where can I know the procedure to use the profiler.

: Rajesh