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 is used to control Oprofile profiling]
If for any reason you don’t want to profile kernel. You can write:
2: Start the oprofiled daemon to collect profile data.
3: To stop profiling.
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
7101696 72.5786 vmlinux
388399 3.9694 libsqlite3.so.0.8.6
289055 2.9541 libc-2.8.so
249139 2.5462 oprofile
217805 2.2259 oprofiled
150175 1.5348 libpangoft2-1.0.so.0.2000.1
140984 1.4408 libmork.so
126140 1.2891 libpixman-1.so.0.10.0
104014 1.0630 libpoppler.so.3.0.0
100046 1.0225 mplayer
61752 0.6311 unrar