Operating System - Linux
1752805 Members
5437 Online
108789 Solutions
New Discussion юеВ

Re: unable to use profiler

 
itai weisman
Super Advisor

unable to use profiler

Hi ppl,
I'm trying to use profiler on compiled executable, in order to monitor it's performance.
I noticed that after compiling the source (C Source) , with '-p' flag, using cc, the 'mcount', 'monitor' and the library mon.h were included on the executable (I use nm in order to check it), but, when attempting to run the excutable with prof (using prof 'exe') I see no output. moreover, no mon.out file has been created at all.
when I'm trying to compile other sources (much simpler sources) - I see no problem and expected output is being shown.
if anyone has any idea - please let me know!! thanks a lot people.
Itai and Vika.
2 REPLIES 2
MAUCCI_2
Frequent Advisor

Re: unable to use profiler

Hi

you should try to use gprof, not prof
compile with -G.

This is the basic profiler on hpux.

Otherwise, you wanna remove this -G option and try either prospect (www.hp.com/go/prospect) if you are running on PARISC, or caliper if you are running on Itanium.

-Cyrille
Dennis Handly
Acclaimed Contributor

Re: unable to use profiler

It's not clear what you were doing and you said it worked in a small case. So did you use:
$ cc -p foo.c
$ a.out
$ prof a.out

Note if you call _exit, you won't get any output.

And as Cyrille says, you should really be using gprof (-G) or Caliper.