4. Applications of OProfile

OProfile is useful in a number of situations. You might want to use OProfile when you :

OProfile is not a panacea. OProfile might not be a complete solution when you :

4.1. Support for dynamically compiled (JIT) code

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:

  • JVMTI agent library for Java (1.5 and higher)
  • JVMPI agent library for Java (1.5 and lower)

For information on how to use OProfile's JIT support, see Section 3, “Setting up the JIT profiling feature”.

4.2. No support for virtual machine guests

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 5.2, “OProfile in timer interrupt mode”).