This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Tapset difficulties w/ functions
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: <fche at redhat dot com>
- Cc: <systemtap at sourceware dot org>
- Date: Mon, 1 May 2006 10:53:18 -0700
- Subject: RE: Tapset difficulties w/ functions
On Sunday, April 30, 2006 1:05 PM, fche@redhat.com wrote:
> Would this "fault-tolerant" wildcarding have an advantage over an
> explicit "optional probe" syntax like this:
>
> probe FOO ? { }
> probe alias = BAR ?, BAZ ? { }
>
> Then the first alternative would be expressed thusly, if they can
> share handlers:
>
> probe process.exec = kernel.function("do_execve") ?,
> kernel.function("compat_do_execve") ?
> { /* do stuff */ }
Actually, I like this explicitly-optional syntax better -- it would let
me specify in this case that do_execve is required but compat_do_execve
is optional. In this way it is better than the "soft" wildcards.
One strong point of the wildcard is that it does ensure that there's at
least one match. The "optional" flag can be made to do this even better
if we're careful how it's implemented. Looking at your example, if FOO
isn't found then that probe can be discarded. For your alias example, I
think it should work two ways if both BAR and BAZ are not found:
probe alias {} // error, probepoint not found
probe alias ? {} // ok, probe is discarded
Similarly, if a syscall "sys_foobar" isn't found:
tapset:
probe syscall.foobar = kernel.function("sys_foobar") ? {}
user script:
probe syscall.* {} // ok if other syscalls were found
probe syscall.foobar {} // error, probepoint not found
probe syscall.foobar ? {} // ok, probe is discarded
It still would be nice to have some syntactic sugar for
function-or-inline and kernel-or-module, lest we end up with tapsets
littered like so:
probe xyzzy.foo = kernel.function("xyzzy_foo") ?,
kernel.inline("xyzzy_foo") ?,
module("xyzzy").function("xyzzy_foo") ?,
module("xyzzy").inline("xyzzy_foo") ?
{ /* do stuff */ }
Perhaps instead:
probe xyzzy.foo = softmodule("xyzzy").softfunction("xyzzy_foo")
{ /* do stuff */ }
Josh