Tcl User-Space Markers
Tcl since 8.5b1 includes support for SystemTap user-space markers. The Tcl user-space markers are enabled in Fedora 28 and RHEL 7 and allow SystemTap to probe various aspects of Tcl operation such as the start and completion of each Tcl function. Below is the SystemTap command and the resulting output listing the Tcl user-space probes:
$ stap -L 'process("/usr/lib*/libtcl*").mark("*")' process("/usr/lib64/libtcl8.6.so").mark("cmd__args") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long $arg7:long $arg8:long $arg9:long $arg10:long process("/usr/lib64/libtcl8.6.so").mark("cmd__entry") $arg1:long $arg2:long $arg3:long process("/usr/lib64/libtcl8.6.so").mark("cmd__info") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long $arg7:long $arg8:long process("/usr/lib64/libtcl8.6.so").mark("cmd__result") $arg1:long $arg2:long $arg3:long $arg4:long process("/usr/lib64/libtcl8.6.so").mark("cmd__return") $arg1:long $arg2:long process("/usr/lib64/libtcl8.6.so").mark("inst__done") $arg1:long $arg2:long $arg3:long process("/usr/lib64/libtcl8.6.so").mark("inst__start") $arg1:long $arg2:long $arg3:long process("/usr/lib64/libtcl8.6.so").mark("obj__create") $arg1:long process("/usr/lib64/libtcl8.6.so").mark("obj__free") $arg1:long process("/usr/lib64/libtcl8.6.so").mark("proc__args") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long $arg7:long $arg8:long $arg9:long $arg10:long process("/usr/lib64/libtcl8.6.so").mark("proc__entry") $arg1:long $arg2:long $arg3:long process("/usr/lib64/libtcl8.6.so").mark("proc__info") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long $arg7:long $arg8:long process("/usr/lib64/libtcl8.6.so").mark("proc__result") $arg1:long $arg2:long $arg3:long $arg4:long process("/usr/lib64/libtcl8.6.so").mark("proc__return") $arg1:long $arg2:long process("/usr/lib64/libtcl8.6.so").mark("tcl__probe") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long $arg7:long $arg8:long $arg9:long $arg10:long
Using Tcl User-Space Markers
To use the Tcl user-space markers on a Fedora you will need:
- RPMs:
- tcl
- systemtap
- Membership to the stapdev group (or root access)
Examples Scripts for Tcl Probing
Short example scripts:
"top" for Tcl, tcl-funtop.stp
tracing Tcl function calls, tcl-trace.stp