Site Tools


Sidebar

snippets:linux_quickshotsetups:systemtap_rhel6

Setup systemtap on rhel6

rhn_register 
rhn-channel -a -c rhel-x86_64-server-6-debuginfo

yum install systemtap-runtime.x86_64 systemtap.x86_64 kernel-devel.x86_64 \
    kernel-debuginfo-common-x86_64.x86_64 kernel-debuginfo.x86_64
yum update kernel

# example code for testing
stap -v -e 'probe vfs.read { printf("something was read\n"); exit()}'

important things

stap -L 'vfs.read'             # list matching probes and variables
stap -l 'vfs.*'                # list matching probes
stap -L 'kernel.trace("*")'
stap -l 'kernel.function("*")' # list all kernel functions
man stapprobes

example

# cat bnx2_read_rxsize.stp 
#! /usr/bin/env stap

probe module("bnx2").function("bnx2_set_rx_ring_size") 
{
        println("this is module bnx.") ;
        # printf("Ring size previous is %d\n", $rx);
        printf("Ring size previous is %d\n", $size);
        # $size = 9000;
        $rx = 4080;
        printf("Ring size new is %d\n", $size);
}

probe begin { 
        println("probe begin here") 
}
probe end { 
        println("probe end here") 
}
snippets/linux_quickshotsetups/systemtap_rhel6.txt ยท Last modified: 2022/11/13 12:06 by 127.0.0.1