System information

OProfile—System-Wide Profiler 107
Applications usually do not need to profile the Kernel, so better use the --no-vm-
linux option to reduce the amount of information.
8.4.1 General Steps
In its simplest form, start the daemon, collect data, stop the daemon, and create your
report. This method is described in detail in the following procedure:
1 Open a shell and log in as root.
2 Decide if you want to profile with or without the Linux Kernel:
2a Profile With the Linux Kernel Execute the following commands, be-
cause the opcontrol command needs an uncompressed image:
cp /boot/vmlinux-`uname -r`.gz /tmp
gunzip /tmp/vmlinux*.gz
opcontrol --vmlinux=/tmp/vmlinux*
2b Profile Without the Linux Kernel Use the following command:
opcontrol --no-vmlinux
If you want to see which functions call other functions in the output, use ad-
ditionally the --callgraph option and set a maximum DEPTH:
opcontrol --no-vmlinux --callgraph DEPTH
3 Start the OProfile daemon:
opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
4 Start your application you want to profile right after the previous step.
5 Stop the OProfile daemon:
opcontrol --stop
6 Dump the collected data to /var/lib/oprofile/samples:
opcontrol --dump
7 Create a report: