Introduction to OProfile

OProfile is a statistical profiler for Linux systems, capable of profiling all running code at low overhead.

You can use OProfile to profile performance in a single process or running across your entire system. OProfile contains support for hardware performance counters. It profiles hardware and software interrupt handlers, kernel modules, the kernel, shared libraries, and applications.

Note: Many of the previous functions of OProfile have been taken over by perf. For information about migrating from OProfile commands to equivalent perf commands, see Migrating from OProfile to perf, and beyond.

OProfile supports all POWER® architectures that run Linux. OProfile support for Linux on Power is functionally equivalent to support on x86. OProfile is an industry accepted opensource project that is shared across multiple system platforms and operating systems.

OProfile provides several commands and utilities to make profiling your application or system easier. The primary commands are operf, ocount, and opreport. Additional commands, including opannotate and oparchive, are described briefly in the following section.

operf

operf is a profiling tool that uses the Linux kernel performance events subsystem (perf) to profile a single process or the entire system. If you are profiling system-wide, you need to have root authority. operf was introduced in OProfile 0.9.8 and is available with most Linux distributions.

ocount

ocount is a tool that can be used to count native hardware events that occur in either a given application, a set of processes or threads, a subset of active system processors, or the entire system.

opreport

The opreport command provides a flexible and powerful reporting mechanism for the OProfile tools.

opannotate

The opannotate command provides annotated source or assembly code intermingled with instruction sampling counts..

oparchive

The oparchive utility gathers all of the profile data, executable, and libraries necessary to analyze profiling sessions into a specified directory where it can be easily tarred up and moved to other systems for subsequent analysis.

opcontrol

opcontrol was the original method for controlling profiling with OProfile. The opcontrol utility has been depreciated in later versions of OProfile in favor of the operf utility.