Install SystemTap

To begin using SystemTap, install the required packages. To use SystemTap with multiple kernels, install the matching kernel packages for each version.

Before you begin

Procedure

  1. Install the required SystemTap packages:
    # dnf install systemtap
  2. Install the required kernel packages:
    • Using stap-prep:
      # stap-prep
    • If stap-prep does not work, install the required kernel packages manually:
      # dnf install kernel-debuginfo-$(uname -r) kernel-debuginfo-common-$(uname -m)-$(uname -r) kernel-devel-$(uname -r)

      $(uname -m) is automatically replaced with the hardware platform of your system and $(uname -r) is automatically replaced with the version of your running kernel.

Results

  • If the kernel to be probed with SystemTap is currently in use, test if your installation was successful:
    # stap -v -e 'probe kernel.function("vfs_read") {printf("read performed\n"); exit()}'

    For a successful SystemTap deployment, you see an output similar to the following:

    Pass 1: parsed user script and 45 library script(s) in 340usr/0sys/358real ms.
    Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) in 290usr/260sys/568real ms.
    Pass 3: translated to C into "/tmp/stapiArgLX/stap_e5886fa50499994e6a87aacdc43cd392_399.c" in 490usr/430sys/938real ms.
    Pass 4: compiled C into "stap_e5886fa50499994e6a87aacdc43cd392_399.ko" in 3310usr/430sys/3714real ms.
    Pass 5: starting run.
    read performed
    Pass 5: run completed in 10usr/40sys/73real ms.

    where:

  • Pass 5: starting run indicates that SystemTap successfully created the instrumentation to probe the kernel and runs the instrumentation.
  • read performed indicates that SystemTap detected the specified event, in this example, a VFS read.
  • Pass 5: run completed in <time> ms indicates that SystemTap ran a valid handler. It displayed text and closed with no errors.