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

OProfile provides a framework to support JITed code ("just-in-time (JIT) compiled code"). A development library is provided to allow developers to add support for any VM (virtual machine) 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)
These libraries make it possible for OProfile to attribute profile samples to Java methods. Without a VM-specific agent library, OProfile will typically report samples from JITed code similar to the following example:
     anon: <tgid><address range>
For information on how to use OProfile's JIT support, see Section 2, “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. (Note: KVM guests are supported.) The list of supported events displayed by ophelp 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 must use the legacy profiler's timer mode (see Section 3.2, “OProfile timer interrupt mode”).