이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 14. OProfile


OProfile is a low overhead, system-wide profiler that uses the performance-monitoring hardware on the processor to retrieve information about the kernel and executables on the system, such as when memory is referenced, the number of level 2 cache (L2) requests, and the number of hardware interrupts received. It consists of a configuration utility, a daemon for collecting data, and a number of tools that can be used to transform the data into a human-readable form. For a complete list of tools that are distributed with the Red Hat Developer Toolset version of OProfile, see Table 14.1, “Tools Distributed with OProfile for Red Hat Developer Toolset”.

OProfile profiles an application without adding any instrumentation by recording the details of every nth event. This allows it to consume fewer resources than Valgrind, but it also causes its samples to be less precise. Unlike Valgrind, which only collects data for a single process and its children in user-space, OProfile is well suited to collect system-wide data on both user-space and kernel-space processes, and requires root privileges to run.

Red Hat Developer Toolset is distributed with OProfile 1.4.0.

Table 14.1. Tools Distributed with OProfile for Red Hat Developer Toolset
NameDescription

operf

Records samples either for a single process or system-wide using the Linux Performance Events subsystem.

opannotate

Generates an annotated source file or assembly listing from the profiling data.

oparchive

Generates a directory containing executable, debug, and sample files.

opgprof

Generates a summary of a profiling session in a format compatible with gprof.

ophelp

Displays a list of available events.

opimport

Converts a sample database file from a foreign binary format to the native format.

opjitconv

Converts a just-in-time (JIT) dump file to the Executable and Linkable Format (ELF).

opreport

Generates image and symbol summaries of a profiling session.

ocount

A new tool for counting the number of times particular events occur during the duration of a monitored command.

14.1. Installing OProfile

In Red Hat Developer Toolset, OProfile is provided by the devtoolset-12-oprofile package and is automatically installed with devtoolset-12-perftools as described in Section 1.5, “Installing Red Hat Developer Toolset”.

14.2. Using OProfile

To run any of the tools that are distributed with OProfile:

# scl enable devtoolset-12 'tool option...'

See Table 14.1, “Tools Distributed with OProfile for Red Hat Developer Toolset” for a list of tools that are distributed with OProfile. For example, to use the ophelp command to list available events in the XML format:

$ scl enable devtoolset-12 'ophelp -X'

Note that you can execute any command using the scl utility, causing it to be run with the Red Hat Developer Toolset binaries used in preference to the Red Hat Enterprise Linux system equivalent. This allows you to run a shell session with Red Hat Developer Toolset OProfile as default:

$ scl enable devtoolset-12 'bash'
Note

To verify the version of OProfile you are using at any point:

$ which operf

Red Hat Developer Toolset’s operf executable path will begin with /opt. Alternatively, you can use the following command to confirm that the version number matches that for Red Hat Developer Toolset OProfile:

# operf --version

14.3. Additional Resources

For more information about OProfile and its features, see the resources listed below.

Installed Documentation

  • oprofile(1) — The manual page named oprofile provides an overview of OProfile and available tools. To display the manual page for the version included in Red Hat Developer Toolset:

    $ scl enable devtoolset-12 'man oprofile'
  • opannotate(1), oparchive(1), operf(1), opgprof(1), ophelp(1), opimport(1), opreport(1) — Manual pages for various tools distributed with OProfile provide more information on their respective usage. To display the manual page for the version included in Red Hat Developer Toolset:

    scl enable devtoolset-12 'man tool'

Online Documentation

See Also

  • Chapter 1, Red Hat Developer Toolset — An overview of Red Hat Developer Toolset and more information on how to install it on your system.
  • Chapter 12, SystemTap — An introduction to SystemTap and instructions on how to use it to monitor the activities of a running system.
  • Chapter 13, Valgrind — Instructions on using the Valgrind tool to profile applications and detect memory errors and memory management problems, such as the use of uninitialized memory, improper allocation and freeing of memory, and the use of improper arguments in system calls.
  • Chapter 15, Dyninst — Instructions on using the Dyninst library to instrument a user-space executable.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.