Click to See Complete Forum and Search --> : Getting started with gprof


dude_1967
October 12th, 2002, 05:27 AM
Hello Gurus,

Can anyone tell me in a few simple steps how to get started with the code profiler gprof? I compiled and linked with the -pg flag and do not know how to proceed.

The program to be tested performs computationally-intensive floating point calculations.

I would appreciate any help in this matter.

Thanks. Chris.

:)

cup
October 12th, 2002, 12:45 PM
Long time since I've used gprof but it is something like this. Say your program is xxx. Run xxx. This will generate a file called gmon.out. Then

gprof xxx

It will pick up gmon.out and display the relevant info. There are a whole bunch of switches which go with gprof. You'll have to look up the man page for these.

dude_1967
October 12th, 2002, 03:57 PM
Thanks cup,

I'm up and running with gprof. It has already provided some keen insights.

I found the following flags to be OK for a brief, clear summary:

gprof xxx.exe --brief --flat-profile

Chris.

:)