Posts Tagged ‘oprofile’

Last week I digged more about Oprofile. I had heard about it before and have gone
through some sample outputs of it but had not tried it myself!

After getting a good hand on Systemtap. I can say stap can do anything magical in
Kernel Space. So I just wanted to check the “Can be” and “Can’t be” bits of Oprofile.

In one word I can say, Oprofile is a system-wide performance monitoring tool. And
it’s capable of profiling all parts of the running system, from the kernel to shared
libraries to libraries.

Here’s a quick low down of the syntaxes to start profiling:

1: Complie and install oprofile.

Note: The minimum setup required for this is to
tell Oprofile where the vmlinux file corresponding
to the running kernel is available.

opcontrol –vmlinux=/path/to/vmlinux

[opcontrol is used to control Oprofile profiling]

If for any reason you don’t want to profile kernel. You can write:

opcontrol –no-vmlinux

2: Start the oprofiled daemon to collect profile data.

opcontrol –start

3: To stop profiling.

opcontrol –shutdown

4: Getting reports.

For systemwide data:


[opreport is used to produce symbol or binary image summaries]

or, to get more detailed summary of a particular image:

opreport -l /path/to/vmlinux

Example: To get system-wide binary image summary

Syntax: opreport –exclude-dependent


CPU: PIII, speed 1867 MHz (estimated)
Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 100000
samples| %|
7101696 72.5786 vmlinux
388399 3.9694
289055 2.9541
249139 2.5462 oprofile
217805 2.2259 oprofiled
150175 1.5348
140984 1.4408
126140 1.2891
104014 1.0630
100046 1.0225 mplayer
61752 0.6311 unrar