> I would appreciate explicit instructions
> on how to get profiling to work under gcc/g++
> on Linux, including version numbers for gcc,
> libraries and kernel. I have read the faq and
> tried numerous times to profile, but have never
> achieved anything other than a program that
> instantly seg-faults.
The seg-faults are probably caused by a mismatch between the libraries.
I had the same problem and ftp'd the Slackware 1.2.0 libc.tgz (disk d5)
and extralib.tgz (d3) files (can't recall the version numbers right now,
sorry). Everything works now. Make sure that your kernel has been
compiled with CONFIG_PROFILE #defined. Then do the following:
1. Compile your program using the "-pg" switch. Use this switch for
every file you want profiled, and link everything with -pg.
2. Run the program. This creates the "gmon.out" file.
3. Do a "gprof <program>" and you get the flat profile and call graph
There are some options for gprof but I don't know what they do. hmm...
I wonder where the man pages could be found? <off to search>