The Open Cybernetics & Systemics Journal
2012, 6 : 11-25Published online 2012 May 9. DOI: 10.2174/1874110X01206010011
Publisher ID: TOCSJ-6-11
Efficient Conditional Tracepoints in Kernel Space
ABSTRACT
With kernel static tracepoints, it is now possible to add instrumentation to the Linux kernel and obtain a low overhead trace of the whole system. However, these static tracepoints may be insufficient to diagnose the source of a functional or performance problem. Dynamic instrumentation fills the gap by enabling the insertion of additional tracepoints in other locations at run time.
This article presents a new approach for tracing the Linux kernel with dynamic and static tracepoints. These tracepoints will be conditional. Conditions are defined using complex expressions that employ the code variables and make use of arithmetic and logic operations. These expressions are written using C-like syntax.
Both static and dynamic tracepoints will evaluate and collect expressions similar to those used for conditions. In addition, static tracepoints will collect the static tracepoint data, as defined by the TRACE_EVENT macro used to define tracepoints in the Linux kernel.
Our tool was implemented based on GDB and KGTP, which is a GDB stub in kernel-space that partially implements dynamic tracepoints.