OPROFILE(1)
π OPROFILE β bestie's guide to the Linux profiler β¨
okay so real talk: this is OPROFILE(1), from the General Commands Manual, and it's literally the moment your code gets a full-on vibe check. no cap. π«Ά
β¨ NAME β¨
oprofile β a statistical profiler for Linux systems, capable of profiling all running code at low overhead; also included is a set of post-profiling analysis tools, as well as a simple event counting tool. it's giving "I see all, I judge none (except your hot loops)". π
πΈ SYNOPSIS πΈ
operf [ options ]
ocount [ options ]
opreport [ options ] [ profile specification ]
opannotate [ options ] [ profile specification ]
oparchive [ options ] [ profile specification ]
opgprof [ options ] [ profile specification ]
like, six whole tools. one friend group. the way they all pull up with their own little arguments. iconic. π
π¦ DESCRIPTION π¦
OProfile is a profiling system for systems running Linux 2.6.31 and greater. okay so it literally uses the hardware performance counters provided on Intel, AMD, and other processors. yes, the actual silicon is doing the gossiping. π
OProfile can profile a selected program or process or the whole system. OProfile can also be used to collect cumulative event counts at the application, process, or system level. so it's like β one program, one process, or the entire system? it does all three. main character energy fr fr. π
for a gentle guide to using OProfile, please read the HTML documentation listed in SEE ALSO. do it. it's the lore. π
π₯ OPERF π₯
operf is a performance profiler tool for Linux. that's it, that's the tweet. β¨
π OCOUNT π
ocount is an event counting tool for Linux. counting events like it's keeping score at a talent show. π―
π OPREPORT π
opreport gives image and symbol-based profile summaries for the whole system or a subset of binary images. receipts. it's literally receipts for your code's behavior. π§Ύ
πΈ OPANNOTATE πΈ
opannotate can produce annotated source or mixed source and assembly output. it will show you exactly where it's at. no hiding. π
π OPARCHIVE π
oparchive produces oprofile archive for offline analysis. save it for later, bestie. πΎ
β OPGPROF β
opgprof can produce a gprof-format profile for a single binary. one binary, one gprof-format profile. slay. π«
π PROFILE SPECIFICATIONS π
Various optional profile specifications may be used with the post-profiling tools. A profile specification is some combination of the parameters listed below.
( Note: Enclosing part of a profile specification in curly braces{ }can be used for differential profiles withopreport, but the braces must be surrounded by whitespace.) okay this is THE sneaky detail. whitespace around the braces. do not forget. π
archive:archive β Path to the archive to inspect, as generated byoparchive.session:sessionlist β A comma-separated list of session names to resolve in. Absence of this tag, unlike all others, means "the current session", equivalent to specifyingsession:current. so if you don't say anything, it assumes current. it's the default bestie. πsession-exclude:sessionlist β A comma-separated list of sessions to exclude. not invited to the party. π«image:imagelist β A comma-separated list of image names to resolve. Each entry may be relative path, glob-style name, or full path, e.g.
opreport 'image:/usr/bin/operf,*op*,./oprofpp'
image-exclude:imagelist β Same asimage:, but the matching images are excluded.lib-image:imagelist β Same asimage:, but only for images that are for a particular primary binary image (namely, an application). This only makes sense to use if you're using--separate. This includes kernel modules and the kernel when using--separate=kernel. like, yes, it knows about the kernel. it's not new here. πlib-image-exclude:imagelist β Same aslib-image:, but the matching images are excluded.event:eventname β The symbolic event name to match on, e.g.event:DATA_MEM_REFS.count:eventcount β The event count to match on, e.g.event:DATA_MEM_REFS count:30000.unit-mask:maskvalue β The unit mask value of the event to match on, e.g.unit-mask:1.cpu:cpulist β Only consider profiles for the given numbered CPU (starting from zero). This is only useful when using CPU profile separation. zero-indexed, as always. πtgid:pidlist β Only consider profiles for the given task groups. Unless some program is using threads, the task group ID of a process is the same as its process ID. This option corresponds to the POSIX notion of a thread group. This is only useful when using per-process profile separation.tid:tidlist β Only consider profiles for the given threads. When using recent thread libraries, all threads in a process share the same task group ID, but have different thread IDs. You can use this option in combination withtgid:to restrict the results to particular threads within a process. This is only useful when using per-process profile separation. nesting your filters? highkey powerful. π
πΏ ENVIRONMENT πΏ
No special environment variables are recognized by OProfile. literally none. it's not that kind of tool. nothing to export, nothing to source. π
π FILES π
/usr/share/doc/oprofile/oprofile.htmlβ OProfile user guide. the sacred text. π/usr/share/doc/oprofile/opreport.xsdβ Schema file foropreportXML output. schema queen. π§Ύ/usr/share/doc/oprofile/ophelp.xsdβ Schema file forophelpXML output./usr/share/oprofile/β Event description files used by OProfile.<session-dir>/samples/operf.logβ The profiler log file. it's logging everything. always. π<session-dir>/samples/currentβ The location of the generated sample files.
π·οΈ VERSION π·οΈ
This man page is current for oprofile-1.4.0. yes, we're on 1.4.0. keep up bestie. π
π SEE ALSO π
/usr/share/doc/oprofile/operf(1)ocount(1)opreport(1)opannotate(1)oparchive(1)opgprof(1)gprof(1)- CPU vendor architecture manuals
go read the CPU vendor architecture manuals. they're giving ancient scrolls but make it silicon. πβ¨
Β©οΈ COPYRIGHT Β©οΈ
oprofile is Copyright (C) 1998-2004 University of Manchester, UK, John Levon, and others. OProfile is released under the GNU General Public License, Version 2, or (at your option) any later version. legal queen. πΌπ
ποΈ AUTHORS ποΈ
John Levon <levon@movementarian.org> is the primary author. See the documentation for other contributors. the founder. the blueprint. π«Ά
and that's the whole page, bestie β 4th Berkeley Distribution, Thu 28 September 2023, signing off π β¨
π¦ where this page comes from
- opensuse-leap 16.0: oprofile 1.4.0-bp160.1.14 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: oprofile 1.4.0-bp160.1.14 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: oprofile 1.4.0-bp160.1.14 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: oprofile 1.4.0-bp160.1.14 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms