Preface v
1. Document Conventions .......................................................................................................... v
1.1. Typographic Conventions ............................................................................................ v
1.2. Pull-quote Conventions .............................................................................................. vi
1.3. Notes and Warnings .................................................................................................. vii
2. We Need Feedback! ............................................................................................................ vii
1. Introduction 1
1.1. Documentation Goals ......................................................................................................... 1
1.2. SystemTap Capabilities ...................................................................................................... 1
1.3. Limitations of SystemTap .................................................................................................... 1
2. Using SystemTap 3
2.1. Installation and Setup ......................................................................................................... 3
2.1.1. Installing SystemTap ................................................................................................ 3
2.1.2. Installing Required Kernel Information Packages Manually ......................................... 3
2.1.3. Initial Testing ........................................................................................................... 5
2.2. Generating Instrumentation for Other Computers ................................................................. 5
2.3. Running SystemTap Scripts ................................................................................................ 7
2.3.1. SystemTap Flight Recorder Mode ............................................................................ 9
2.3.1.1. In-memory Flight Recorder ............................................................................ 9
2.3.1.2. File Flight Recorder ..................................................................................... 10
3. Understanding How SystemTap Works 11
3.1. Architecture ...................................................................................................................... 11
3.2. SystemTap Scripts ............................................................................................................ 11
3.2.1. Event .................................................................................................................... 13
3.2.2. SystemTap Handler/Body ....................................................................................... 15
3.3. Basic SystemTap Handler Constructs ................................................................................ 19
3.3.1. Variables ............................................................................................................... 19
3.3.2. Target Variables .................................................................................................... 20
3.3.2.1. Pretty Printing Target Variables ................................................................... 22
3.3.2.2. Typecasting ................................................................................................ 23
3.3.2.3. Checking Target Variable Availability ............................................................ 23
3.3.3. Conditional Statements .......................................................................................... 24
3.3.4. Command-Line Arguments ..................................................................................... 25
3.4. Associative Arrays ............................................................................................................ 26
3.5. Array Operations in SystemTap ......................................................................................... 26
3.5.1. Assigning an Associated Value ............................................................................... 27
3.5.2. Reading Values From Arrays .................................................................................. 27
3.5.3. Incrementing Associated Values ............................................................................. 28
3.5.4. Processing Multiple Elements in an Array ............................................................... 28
3.5.5. Clearing/Deleting Arrays and Array Elements .......................................................... 29
3.5.6. Using Arrays in Conditional Statements .................................................................. 31
3.5.7. Computing for Statistical Aggregates ...................................................................... 32
3.6. Tapsets ............................................................................................................................ 34
4. User-space Probing 35
4.1. User-Space Events ........................................................................................................... 35
4.2. Accessing User-Space Target Variables ............................................................................ 36
4.3. User-Space Stack Backtraces ........................................................................................... 37
iii