Skip to content

eric-zhu/ktap

 
 

Repository files navigation

ktap

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.

Building & Running

  1. Clone ktap from github

    [root@jovi]# git clone http://github.com/ktap/ktap.git

  2. Compiling ktap

    [root@jovi]# cd ktap [root@jovi]# make #generate ktapvm kernel module [root@jovi]# make ktap #generate userspace ktap tool

  3. Insert ktapvm kernel module

    [root@jovi]# insmod ./ktapvm.ko

  4. Running ktap

    [root@jovi]# ./ktap scripts/syscalls.kp

Example of syscall tracing

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")
})

Mailing list

ktap@freelists.org
You can subscribe KTAP mailing list at link: http://www.freelists.org/list/ktap

License

KTAP is built from scratch, with GPL licensed.
https://github.com/ktap/ktap.git

Contribution

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.

About

Dynamic tracing tool for Linux

Resources

Stars

Watchers

Forks

Packages

No packages published