1748281 Members
3967 Online
108761 Solutions
New Discussion

Re: gprof

 
Cody Godines_1
Occasional Advisor

gprof

Hello,
I'm using an f77 compiler. Is using gprof as easy as:
f77 -G file.f
gprof a.out

Because that is what I understand from the manual. Yes, I did set GPROFDIR to my cwd.
Thanks,
Cody
1 REPLY 1
Mike Stroyan
Honored Contributor

Re: gprof

That is basically right.
You did miss running a.out
before running "gprof a.out".
The instrumented a.out will create a gmon.out file when it exits normally. The gprof command will read that gmon.out and format it using the symbol information from a.out.
Depending on the HP-UX release that you are using, you may also want to try some of the other profiling tools like puma, cxperf, caliper, or prospect. Different tools work on different releases. They each have their own strengths and weaknesses. (The most troubling weakness of gprof is that it is usually blind to time spent in shared libraries.)