This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
new static user probe types
- From: Stan Cox <scox at redhat dot com>
- To: systemtap at sourceware dot org
- Date: Fri, 26 Jun 2009 17:26:33 -0400
- Subject: new static user probe types
There are now two new static user probe types, one that uses utrace
and one that uses kprobes. They are currently available by compiling
with -DEXPERIMENTAL_UTRACE_SDT and -DEXPERIMENTAL_KPROBE_SDT. The
code in tapsets.cxx has been refactored by creating a probe_table and an
sdt_var_expanding_visitor. The probe_table handles retrieving probes
from the .probes section and building an stap probe. The
sdt_var_expanding_visitor handles expanding arguments.
A kprobe probe currently maps to the getegid syscall. The
probe_table::convert_probe method will synthesize something like this:
The string comparison is acknowledged to be expensive and needs to be
replaced by an integer comparison.
kernel.function("*sys_getegid*")
{
// Only done for i386
regparm(0)
// Did we get here for the probe in question?
if ((user_string(ulong_arg(1))) != ("test_probe_4")) next
}
A utrace probe uses a dummy syscall value and uses the stap utrace
syscall infrastructure. The probe_table::convert_probe method will
synthesize something like this:
process("PATH").syscall
{
// Did we get here for the probe in question?
if ((user_string(_utrace_syscall_arg(0))) != ("test_probe_4")) next
// Is this the expected task?
if ((task_tid(task_current())) != (_utrace_syscall_arg(1))) next
// Is this the "fake" syscall from the sdt probe?
if ((_utrace_syscall_nr()) != (48813)) next
}