#! /bin/sh stap -p4 -g $@ - <<'END' %{ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) #include #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) #include #else #include #endif %} function get_release () %{ strlcpy(STAP_RETVALUE, UTS_RELEASE, MAXSTRINGLEN); %} probe begin { log("hello from systemtap, kernel version " . get_release()) } END