Operating System - HP-UX
1755692 Members
3309 Online
108837 Solutions
New Discussion юеВ

prof on HP-UX 11.11 with 64 bit executables

 
JJ_4
Frequent Advisor

prof on HP-UX 11.11 with 64 bit executables

Hi,
With the following program :

# include
void main()
{
printf("Hello World\n");
exit(0);
}

If I compile with :

cc -p hello.c
run it
prof -m mon.out a.out
works fine

If I compile with :
cc -p hjello.c +DA2.0W
run it
no mon.out file is produced

Am I missing something?
Not enough Zappa makes you sad.
3 REPLIES 3
Mike Stroyan
Honored Contributor

Re: prof on HP-UX 11.11 with 64 bit executables

You can use gprof with 64-bit executables by compiling with -G and using "gprof a.out gmon.out".

Both prof and gprof have difficulty with profiling shared libraries. I usually go straight to the prospect profiler for PA-RISC. It is available from http://www.hp.com/go/prospect .
It will give function level or instruction level profiles of programs and their shared libraries without any special compilation options.
JJ_4
Frequent Advisor

Re: prof on HP-UX 11.11 with 64 bit executables

Right, when compiling under 64 bit, prof produces no mon.out, and gprof fails!

Under 32 bit all is fine ...

/tmp/hp_forum > cc hello.c -o hello -p
/tmp/hp_forum > ./hello
Hello World
/tmp/hp_forum > prof -m mon.out hello
No time accumulated
%Time Seconds Cumsecs #Calls msec/call Name

0.0 0.00 0.00 4 0.00 __errno
...
etc.

/tmp/hp_forum > cc hello.c -o hello -G
/tmp/hp_forum > ./hello
Hello World
/tmp/hp_forum > gprof hello gmon.out| pg

granularity: each sample hit covers 4 byte(s) no time accumulated
...etc...
%time cumsecs seconds calls msec/call name
0.0 0.00 0.00 4 0.00 __errno

However, when compiling to 64 bit ...

/tmp/hp_forum > cc hello.c -o hello -p +DA2.0W
/tmp/hp_forum > ./hello
Hello World
/tmp/hp_forum > ls
hello hello.c

and

/tmp/hp_forum > cc hello.c -o hello -G +DA2.0W
/tmp/hp_forum > ./hello
Hello World
/tmp/hp_forum > gprof hello gmon.out
Memory fault(coredump)
/tmp/hp_forum > ls
core gmon.out hello hello.c

gprof SEGVs with the following :

read(3, "\0\0fc` \0\0fd040402\0\b\0\0\012".., 8192) ...... = 8192
Received signal 11, SIGSEGV, in user mode, [SIG_DFL], partial siginfo
Siginfo: si_code: I_NONEXIST, faulting address: 0x4002000c, si_errno: 0
PC: 0x9957, instruction: 0x49a80008
exit(11) [implicit] ...................................... WIFSIGNALED(SIGSEGV)|WCOREDUMP

Any clues??
Not enough Zappa makes you sad.
Mike Stroyan
Honored Contributor

Re: prof on HP-UX 11.11 with 64 bit executables

You should put on patch PHCO_20918 to fix the 64-bit gprof problem.