Oprofile : Getting Started

Posted: June 18, 2008 in Tools
Tags: , ,

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

[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

Output:

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
CPU_CLK_UNHALT…|
samples| %|
——————
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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s