public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* new static user probe types
@ 2009-06-26 21:26 Stan Cox
  2009-07-15 16:19 ` Stan Cox
  0 siblings, 1 reply; 16+ messages in thread
From: Stan Cox @ 2009-06-26 21:26 UTC (permalink / raw)
  To: systemtap

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
}

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-07-29 15:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 21:26 new static user probe types Stan Cox
2009-07-15 16:19 ` Stan Cox
2009-07-15 18:39   ` Josh Stone
2009-07-15 20:47     ` Stan Cox
2009-07-15 21:57       ` Josh Stone
2009-07-16 13:44         ` Stan Cox
2009-07-20 18:34   ` Stan Cox
2009-07-22 10:42     ` Mark Wielaard
2009-07-22 14:39       ` Frank Ch. Eigler
2009-07-22 17:10         ` Mark Wielaard
2009-07-29 15:44           ` Stan Cox
2009-07-29 15:51             ` Stan Cox
2009-07-23  3:07       ` Roland McGrath
2009-07-23 10:28         ` Mark Wielaard
2009-07-23 14:40           ` Frank Ch. Eigler
2009-07-23 19:33           ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).