OProfile

From Wikipedia, the free encyclopedia
(Redirected from Oprofile)
Jump to navigation Jump to search
OProfile
Original authorJohn Levon
Initial release2001
Stable release
1.4.0 / July 20, 2020; 5 years ago (2020-07-20)
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Written inC
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemLinux
    PlatformCross-platform
    TypeProfiler
    LicenseGPL
    Websiteoprofile.sourceforge.net/news/

    In computing, OProfile is a system-wide statistical profiling tool for Linux. John Levon wrote it in 2001 for Linux kernel version 2.4 after his M.Sc. project;[1] it consists of a kernel module, a user-space daemon and several user-space tools.

    Details

    [edit | edit source]

    OProfile can profile an entire system or its parts, from interrupt routines or drivers, to user-space processes. It has low overhead.

    The most widely supported kernel mode of oprofile uses a system timer (See: Gathering profiling events). However, this mode is unable to measure kernel functions where interrupts are disabled. Newer CPU models support a hardware performance counter mode which uses hardware logic to record events without any active code needed. In Linux 2.2/2.4 only 32-bit x86 and IA64 are supported; in Linux 2.6 there is wider support: x86 (32 and 64 bit), DEC Alpha, MIPS, ARM, sparc64, ppc64, AVR32.

    Call graphs are supported only on x86 and ARM.

    In 2012 two IBM engineers recognized OProfile as one of the two most commonly used performance counter monitor profiling tools on Linux, alongside perf tool.[2]

    In 2021, OProfile is set to be removed from version 5.12 of the Linux kernel, with the user-space tools continuing to work by using the kernel's perf system.[3]

    User-space tools

    [edit | edit source]
    • opcontrol is used to start and stop the daemon, which collects profiling data. This data is periodically saved to the /var/lib/oprofile/samples directory.
    • opreport shows basic profiling data. opannotate can produce annotated sources or assembly.
    • opgprof converts from oprofile data into gprof-compatible format.[4]

    Example:

    $ opcontrol --start # If there are any issues in starting like --vm-linux just follow the instructions
    
    $ ./${example_file}
    
    $ opcontrol --dump
    
    $ opreport -l ${example_file} > ${output_file}
    
    $ opcontrol --stop # stops collecting the data
    
    $ opcontrol --shutdown # stops the demon
    
    $ opcontrol --reset # clears the profile data which was stored in the sample file given
    

    See also

    [edit | edit source]

    References

    [edit | edit source]
    1. ^ Interview: John Levon Archived 2012-05-13 at the Wayback Machine, 11 Nov 2001 // KernelTrap: "John Levon, the author of OProfile"
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]