[Openmcl-devel] oprofile and call graph reporting

R. Matthew Emerson rme at clozure.com
Thu Jun 3 10:09:21 PDT 2010

On a very recent Linux system (oprofile 0.9.6, kernel 2.6.32), I can get call graph information out of oprofile.  Earlier versions might work too, but ancient distributions like Fedora Core 3 don't include a new enough oprofile.

After following the instructions in the CCL manual to create an image with ELF symbols, here's what I do to control oprofile.

root at pip:~/ccl# opcontrol --start
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
root at pip:~/ccl# opcontrol --status
Daemon running: pid 2167
Separate options: none
vmlinux file: none
Image filter: none
Call-graph depth: 5

[run the lisp here...]

root at pip:~/ccl# opcontrol --dump
root at pip:~/ccl# opreport --callgraph -l /home/rme/ccl/pccl.image | more

Sample output from running (compile-file "ccl:compiler;X86;x862.lisp") two times is at http://www.clozure.com/~rme/report.text

In this example, scroll down a few dozen lines until you see a non-indented line for STRUCTURE-TYPEP.  The lines above that are its callers.  The oprofile manual at http://oprofile.sourceforge.net/doc/opreport.html#opreport-callgraph has more information about interpreting the output.

More information about the Openmcl-devel mailing list