Profiling Code

Sriranga Veeraraghavan ranga at CSUA.Berkeley.EDU
Mon Sep 20 17:48:48 EST 1999


I have been trying to profile a small C program under LinuxPPC, but I
can't gprof to run. (I couldn't find prof on my box).

Bascially my make rule for profiling executes the following code:

$ gcc -pg -Wall -pedantic -o prog prog.c

This compiles just fine. When I execute the program it creates the
gmon.out file correctly. If I run gprof against this gmon.out file, I
get a seg fault:

$ gprof prog gmon.out
Segmentation fault

ldd on gprof looks okay:

$ ldd /usr/bin/gprof => /usr/lib/ (0x01753000) => /lib/ (0x01611000)
        /lib/ => /lib/ (0x30000000)

I am able to build with profiling on my Solaris box and Linux x86 just
fine (for the exact same program), so I think that I'm not doing
something correctly on PPC.

If anyone has been able profile thier code under LinuxPPC, I would
appreciate some pointers.


----ranga <ranga at>

** Sent via the linuxppc-dev mail list. See

More information about the Linuxppc-dev mailing list