A.14. OProfile
OProfile is a low overhead, system-wide performance monitoring tool provided by the oprofile package. It uses the performance monitoring hardware on the processor to retrieve information about the kernel and executables on the system, such as when memory is referenced, the number of second-level cache requests, and the number of hardware interrupts received. OProfile is also able to profile applications that run in a Java Virtual Machine (JVM).
OProfile provides the following tools. Note that the legacy
opcontrol
tool and the new operf
tool are mutually exclusive.
- ophelp
- Displays available events for the system’s processor along with a brief description of each.
- opimport
- Converts sample database files from a foreign binary format to the native format for the system. Only use this option when analyzing a sample database from a different architecture.
- opannotate
- Creates annotated source for an executable if the application was compiled with debugging symbols.
- opcontrol
- Configures which data is collected in a profiling run.
- operf
- Intended to replace
opcontrol
. Theoperf
tool uses the Linux Performance Events subsystem, allowing you to target your profiling more precisely, as a single process or system-wide, and allowing OProfile to co-exist better with other tools using the performance monitoring hardware on your system. Unlikeopcontrol
, no initial setup is required, and it can be used without the root privileges unless the--system-wide
option is in use. - opreport
- Retrieves profile data.
- oprofiled
- Runs as a daemon to periodically write sample data to disk.
Legacy mode (
opcontrol
, oprofiled
, and post-processing tools) remains available, but is no longer the recommended profiling method.
For further information about any of these commands, see the OProfile man page:
$ man oprofile