0% found this document useful (0 votes)
11 views6 pages

009 Configuring Systems To Run SystemTap Scripts Part 2 Study Guide

009 Configuring Systems to Run SystemTap Scripts Part 2 Study Guide

Uploaded by

fqchina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

009 Configuring Systems To Run SystemTap Scripts Part 2 Study Guide

009 Configuring Systems to Run SystemTap Scripts Part 2 Study Guide

Uploaded by

fqchina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Configuring Systems to

Run SystemTap Scripts


Mike Bunch
LINUX TRAINING ARCHITECT
CONFIGURING SYSTEMS TO RUN SYSTEMTAP SCRIPTS

Lesson Objectives and Overview

Lesson Objective
Review how to use SystemTap scripts for performance monitoring and test a couple of scripts to see how
they can be used to provide more detail compared to other utilities and processes may offer.

Lesson Notes
What Is SystemTap?
A tracing tool used to monitor a system without the need to recompile, install, and reboot. It
offers customization via script for tracing, filtering, and analyzing as well as providing a look at
the kernel and running applications.

Useful SystemTap Resources

Official SystemTap Website - https://sourceware.org/systemtap/

Documentation - https://sourceware.org/systemtap/documentation.html
CONFIGURING SYSTEMS TO RUN SYSTEMTAP SCRIPTS

Command Examples From the Lesson

# Course GitHub link:


https://github.com/linuxacademy/content-course-red-hat-certified-specialist-
performance-tuning-EX442

# Install SystemTap using the Red Hat Development package:


sudo yum group install "Development Tools"
-- ALTERNATIVE - Install SystemTap without the full Dev Tools suite:
sudo yum install systemtap systemtap-runtime

# Install the latest version of the coreutils package:


sudo yum install coreutils

# Install kernel information packages:


sudo stap-prep
CONFIGURING SYSTEMS TO RUN SYSTEMTAP SCRIPTS

Command Examples From the Lesson

# If stap-prep does not work, manually install kernel packages:


name -r
-- Collect the kernel version
sudo yum install kernel-debuginfo kernel-debuginfo-common kernel-devel-
KERNELVER
-- The devel package must match the kernel version/variant and architecture
of the kernel. The package names may vary if PAE is involved.

# Test SystemTap installation:


sudo stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'

# Execute a simple script using SystemTap:


sudo stap -e 'probe kernel.function("do_sys_open") {log("hello world") exit()}'
-- Add "-v" for verbose mode to view each pass. The more v's added, the more
verbose the output will become.
CONFIGURING SYSTEMS TO RUN SYSTEMTAP SCRIPTS

Command Examples From the Lesson

# Review disk reads/writes on an interval:


sudo stap disktop.stp

# Collect and review syscall.read events:


sudo stap eventcount.stp 'syscall.read'

# Review package and data sent/received by processed PIDs and commands:


sudo stap nettop.stp

# Collect and display incoming TCP connection data:


sudo stap tcp_connections.stp
CONFIGURING SYSTEMS TO RUN SYSTEMTAP SCRIPTS

Command Examples From the Lesson

# Monitor process creation/termination and module [un]loading:


sudo stap procmod_watcher.stp

# Monitor all typing activity, displaying recent key strokes:


sudo stap -g ttyspy.stp

# Monitor arbitrary events:


sudo stap watchdog.stp 'syscall.nanosleep' 'syscall.nanosleep.return' 1000

You might also like