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

Chapter 12. SystemTap


SystemTap is a tracing and probing tool that allows users to monitor the activities of the entire system without needing to instrument, recompile, install, and reboot. It is programmable with a custom scripting language, which gives it expressiveness (to trace, filter, and analyze) and reach (to look into the running kernel and applications).

SystemTap can monitor various types of events, such as function calls within the kernel or applications, timers, tracepoints, performance counters, and so on. Some included example scripts produce output similar to netstat, ps, top, and iostat, others include pretty-printed function callgraph traces or tools for working around security bugs.

Red Hat Developer Toolset is distributed with SystemTap 4.7. This version is more recent than the version included in the previous release of Red Hat Developer Toolset and provides numerous bug fixes and enhancements.

Table 12.1. Tools Distributed with SystemTap for Red Hat Developer Toolset
NameDescription

stap

Translates probing instructions into C code, builds a kernel module, and loads it into a running Linux kernel.

stapdyn

The Dyninst backend for SystemTap.

staprun

Loads, unloads, attaches to, and detaches from kernel modules built with the stap utility.

stapsh

Serves as a remote shell for SystemTap.

stap-prep

Determines and—if possible—downloads the kernel information packages that are required to run SystemTap.

stap-merge

Merges per-CPU files. This script is automatically executed when the stap utility is executed with the -b command line option.

stap-report

Gathers important information about the system for the purpose of reporting a bug in SystemTap.

stap-server

A compile server, which listens for requests from stap clients.

12.1. Installing SystemTap

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

In order to place instrumentation into the Linux kernel, SystemTap may also require installation of additional packages with debugging information. To determine which packages to install, run the stap-prep utility as follows:

$ scl enable devtoolset-12 'stap-prep'

Note that if you execute this command as the root user, the utility automatically offers the packages for installation. For more information on how to install these packages on your system, see the Red Hat Enterprise Linux 7 SystemTap Beginners Guide.

12.2. Using SystemTap

To execute any of the tools that are part of SystemTap:

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

See Table 12.1, “Tools Distributed with SystemTap for Red Hat Developer Toolset” for a list of tools that are distributed with SystemTap. For example, to run the stap tool to build an instrumentation module:

$ scl enable devtoolset-12 'stap option... argument...'

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 SystemTap as default:

$ scl enable devtoolset-12 'bash'
Note

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

$ which stap

Red Hat Developer Toolset’s stap 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 SystemTap:

$ stap -V

12.3. Additional Resources

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

Installed Documentation

  • stap(1) — The manual page for the stap command provides detailed information on its usage, as well as references to other related manual pages. To display the manual page for the version included in Red Hat Developer Toolset:

    $ scl enable devtoolset-12 'man stap'
  • staprun(8) — The manual page for the staprun command provides detailed information on its usage. To display the manual page for the version included in Red Hat Developer Toolset:

    $ scl enable devtoolset-12 'man staprun'

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 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 14, OProfile — Instructions on using the OProfile tool to determine which sections of code consume the greatest amount of CPU time and why.
  • 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.