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

2.2. Generating Instrumentation for Other Computers


When users run a SystemTap script, a kernel module is built out of that script. SystemTap then loads the module into the kernel, allowing it to extract the specified data directly from the kernel (see Procedure 3.1, “SystemTap Session” in Section 3.1, “Architecture” for more information).
Normally, SystemTap scripts can only be run on systems where SystemTap is deployed (as in Section 2.1, “Installation and Setup”). This could mean that to run SystemTap on ten systems, SystemTap needs to be deployed on all those systems. In some cases, this may be neither feasible nor desired. For instance, corporate policy may prohibit an administrator from installing packages that provide compilers or debug information on specific machines, which will prevent the deployment of SystemTap.
To work around this, use cross-instrumentation. Cross-instrumentation is the process of generating SystemTap instrumentation modules from a SystemTap script on one computer to be used on another computer. This process offers the following benefits:
  • The kernel information packages for various machines can be installed on a single host machine.
  • Each target machine only needs one package to be installed to use the generated SystemTap instrumentation module: systemtap-runtime.

Important

The host system must be the same architecture and running the same distribution of Linux as the target system in order for the built instrumentation module to work.

Note

For the sake of simplicity, the following terms will be used throughout this section:
instrumentation module
The kernel module built from a SystemTap script; the SystemTap module is built on the host system, and will be loaded on the target kernel of the target system.
host system
The system on which the instrumentation modules (from SystemTap scripts) are compiled, to be loaded on target systems.
target system
The system in which the instrumentation module is being built (from SystemTap scripts).
target kernel
The kernel of the target system. This is the kernel which loads/runs the instrumentation module.

Procedure 2.1. Configuring a Host System and Target Systems

  1. Install the systemtap-runtime package on each target system.
  2. Determine the kernel running on each target system by running uname -r on each target system.
  3. Install SystemTap on the host system. The instrumentation module will be built for the target systems on the host system. For instructions on how to install SystemTap, see Section 2.1.1, “Installing SystemTap”.
  4. Using the target kernel version determined earlier, install the target kernel and related packages on the host system by the method described in Section 2.1.2, “Installing Required Kernel Information Packages”. If multiple target systems use different target kernels, repeat this step for each different kernel used on the target systems.
After performing Procedure 2.1, “Configuring a Host System and Target Systems”, the instrumentation module (for any target system) can be built on the host system.
To build the instrumentation module, run the following command on the host system (be sure to specify the appropriate values):
stap -r kernel_version script -m module_name -p4
Here, kernel_version refers to the version of the target kernel (the output of uname -r on the target machine), script refers to the script to be converted into an instrumentation module, and module_name is the desired name of the instrumentation module.
Once the instrumentation module is compiled, copy it to the target system and then load it using:
staprun module_name.ko
For example, to create the simple.ko instrumentation module from a SystemTap script named simple.stp for the 3.10.0-327.4.4.el7 target kernel, use the following command:
stap -r 2.6.32-53.el6 -e 'probe vfs.read {exit()}' -m simple -p4
This will create a module named simple.ko. To use the simple.ko instrumentation module, copy it to the target system and run the following command (on the target system):
staprun simple.ko
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.