A New Scripting Dynamic Tracing Tool For Linux
KTAP is a new scripting dynamic tracing tool for Linux, it uses a scripting language and lets users trace the Linux kernel dynamically. KTAP is designed to give operational insights with interoperability that allow users to tune, troubleshoot and extend kernel and application. It's similar with Linux Systemtap and Solaris Dtrace.
KTAP have different design principles from Linux mainstream dynamic tracing language in that it's based on bytecode, so it doesn't depend upon GCC, doesn't require compiling a kernel module, safe to use in production environment, fulfilling the embedd ecosystem's tracing needs.
KTAP also is designed for enabling great interoperability with Linux kernel, it gives user the power to modify and extend the system, and let users explore the system in an easy way.
More information can be found at doc/ directory.
-
Clone ktap from github
[root@jovi]# git clone http://github.com/ktap/ktap.git
-
Compiling ktap
[root@jovi]# cd ktap [root@jovi]# make #generate ktapvm kernel module and ktap binary
-
Insert ktapvm kernel module
[root@jovi]# insmod ./ktapvm.ko
-
Running ktap
[root@jovi]# ./ktap scripts/syscalls.kp
syscalls.kp:
function eventfun (e) {
printf("%d %d\t%s\t%s", cpu(), pid(), execname(), e.tostring())
}
kdebug.probe("tp:syscalls", eventfun)
kdebug.probe_end(function () {
printf("probe end\n")
})
[email protected]
You can subscribe KTAP mailing list at link(subscribe before posting):
http://www.freelists.org/list/ktap
ktap is GPL licensed.
See more info in doc/ktap-license.txt.
KTAP is still under active development, so contribution is welcome. You are encouraged to report bugs, provide feedback, send feature request, or hack on it.
LWN review on ktap by Jonathan Corbet: http://lwn.net/Articles/551314/
presentation slides of LinuxCon Japan 2013: http://events.linuxfoundation.org/sites/events/files/lcjpcojp13_zhangwei.pdf