OProfile is useful in a number of situations. You might want to use OProfile when you :
need low overhead
cannot use highly intrusive profiling methods
need to profile interrupt handlers
need to profile an application and its shared libraries
need to profile dynamically compiled code of supported virtual machines (see Section 3.1, “Support for dynamically compiled (JIT) code”)
need to capture the performance behaviour of entire system
want to examine hardware effects such as cache misses
want detailed source annotation
want instruction-level profiles
want call-graph profiles
OProfile is not a panacea. OProfile might not be a complete solution when you :
require call graph profiles on platforms other than x86, ARM, and PowerPC
require 100% instruction-accurate profiles
need function call counts or an interstitial profiling API
cannot tolerate any disturbance to the system whatsoever
need to profile interpreted or dynamically compiled code of non-supported virtual machines
Older versions of OProfile were not capable of attributing samples to symbols from dynamically compiled code, i.e. "just-in-time (JIT) code". Typical JIT compilers load the JIT code into anonymous memory regions. OProfile reported the samples from such code, but the attribution provided was simply:
anon: <tgid><address range> |
Due to this limitation, it wasn't possible to profile applications executed by virtual machines (VMs) like the Java Virtual Machine. OProfile now contains an infrastructure to support JITed code. A development library is provided to allow developers to add support for any VM that produces dynamically compiled code (see the OProfile JIT agent developer guide). In addition, built-in support is included for the following:
For information on how to use OProfile's JIT support, see Section 4, “Setting up the JIT profiling feature”.
OProfile currently does not support event-based profiling (i.e, using hardware events like cache misses, branch mispredicts) on virtual machine guests running under systems such as VMware. The list of supported events displayed by ophelp or 'opcontrol --list-events' is based on CPU type and does not take into account whether the running system is a guest system or real system. To use OProfile on such guest systems, you can use timer mode (see Section 6.2, “OProfile in timer interrupt mode”).