OProfile

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.

OProfile
Original author(s)John Levon
Initial release2001
Stable release
1.3.0 / July 16, 2018 (2018-07-16)
Written inC
Operating systemLinux
PlatformCross-platform
TypeProfiler
LicenseGPL
Websiteoprofile.sourceforge.net/news/

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]

User-space tools

  • 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.[3]

Example:

 opcontrol --start ( If there are any issues in starting like --vm-linux just follow the instructions)

 run <example>

 opcontrol --dump

 opreport -l <example> > <outputfile>

 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)

gollark: I passed it on to someone else, and they said it looked like a variant on the "mirai" botnet thing, which was open-sourced by its creators a few years back.
gollark: Those are some of the random strings in it, I don't know if it uses them at all.
gollark: Here's the script it tries to run.
gollark: However, I *did* run `strings` over them, and they contain what looks like obfuscated data of some sort, HTTP request text which seems to be for spreading the exploit to other stuff, and also seemingly random spammy strings which look like edgy teenagers added them.
gollark: I don't know exactly, reverse-engineering is hard.

See also

References

  1. Interview: John Levon Archived 2012-05-13 at the Wayback Machine, 11 Nov 2001 // KernelTrap: "John Levon, the author of OProfile"
  2. Netto, Adhemerval Zanella; Arnold, Ryan S. (2012-06-12). "Evaluate performance for Linux on POWER: Analyze performance using Linux tools". developerWorks. IBM DeveloperWorks Technical library. IBM. Retrieved 2014-10-21. The two most commonly-used tools for PCM profiling on Linux are OProfile and perf [...].
  3. "4. Tools summary". oprofile.sourceforge.io.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.