Chapter 1. Introduction

Table of Contents

1. OProfile legacy profiling mode
2. OProfile perf_events profiling mode
3. OProfile event counting mode
4. Applications of OProfile
4.1. Support for dynamically compiled (JIT) code
4.2. No support for virtual machine guests
5. System requirements
6. Internet resources
7. Installation
8. Uninstalling OProfile

This manual applies to OProfile version 0.9.9. OProfile is a set of performance monitoring tools for Linux 2.6 and higher systems, available on a number of architectures. OProfile provides the following features:

OProfile is capable of monitoring native hardware events occurring in all parts of a running system, from the kernel (including modules and interrupt handlers) to shared libraries to binaries. OProfile can collect event information for the whole system in the background with very little overhead. These features make it ideal for monitoring entire systems to determine bottle necks in real-world systems.

Many CPUs provide "performance counters", hardware registers that can count "events"; for example, cache misses, or CPU cycles. OProfile can collect profiles of code based on the number of these occurring events: repeatedly, every time a certain (configurable) number of events has occurred, the PC value is recorded. This information is aggregated into profiles for each binary image. Alternatively, OProfile's event counting tool can collect simple raw event counts.

Some hardware setups do not allow OProfile to use performance counters: in these cases, no events are available so OProfile operates in timer mode, as described in later chapters. Timer mode is only available in "legacy profiling mode" (see Section 1, “OProfile legacy profiling mode”).

1. OProfile legacy profiling mode

"Legacy" OProfile consists of the opcontrol shell script, the oprofiled daemon, and several post-processing tools (e.g., opreport). The opcontrol script is used for configuring, starting, and stopping a profiling session. An OProfile kernel driver (usually built as a kernel module) is used for collecting samples, which are then recorded into sample files by oprofiled. Using OProfile in "legacy mode" requires root user authority since the profiling is done on a system-wide basis, which may (if misused) cause adverse effects to the system.


Profiling setup parameters that you specify using opcontrol are cached in /root/.oprofile/daemonrc. Subsequent runs of opcontrol --start will continue to use these cached values until you override them with new values.