===== Setup systemtap on rhel6 ===== * [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/systemtap_beginners_guide/index|SystemTap_Beginners_Guide]] * [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/systemtap_tapset_reference/index|SystemTap_Tapset_Reference]] 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") }