public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* tapset feedback
@ 2006-01-05  8:45 Martin Hunt
  2006-01-05  9:05 ` Roland McGrath
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Hunt @ 2006-01-05  8:45 UTC (permalink / raw)
  To: systemtap

I have a bunch of issues with the current tapsets and the way tapsets
are implemented.  Others have written more tapsets than me and I'd
really like to know what your experiences are and what you think of the
following.

1. My biggest issue with the way tapsets are implemented is that there
are no namespaces or ways to limit the scope of a function. Plus the
concepts of code libraries and tapsets are overlapped.

Why is this a problem? Consider the functions contained in
aux_syscalls.stp. Some of these might be tempting for systemtap script
writers to use. However, some of these functions use embedded-C and are
safe to call only from certain contexts. Allowing any script writer to
use them bypasses our safety checks.

Secondly, we have a problem when two tapset writers mistakenly use the
same name for a function. This is a namespace issue that could be solved
by use of some simple naming convention. So it is not serious like the
first problem. But still an annoyance that needs addressing now, before
we have many people writing tapsets. And the solution for the first
problem might be able to solve both.

One thing I would recommend is a conceptual split between "tapsets",
which export probe points and a system library, which would export
general-purpose safe functions.

2. I am not running 2.6.14, 2.6.9-20.ELsmp, or 2.6.9-24.ELsmp on any of
my machines, so I cannot use the syscalls tapset. I mention this not to
pick on that tapset, but to point out that we have a serious maintenance
problem created by the way we have implemented tapsets. 

3. We need to rethink how we set probes on sets of functions.  By this I
mean when we do things like:

probe kernel.syscall.* or
probe kernel.function("sys_*)

We need to consider the following cases:
A. What if one of the functions matched does not exist in the current
kernel?  Right now the compilation fails.
B. What if one of the functions cannot be probed because it is
blacklisted?
C. What if the function is inlined? See
http://sourceware.org/bugzilla/show_bug.cgi?id=1570

So what does this have to do with tapsets? Plenty. Tapsets are basically
a bunch of probe points with code to safely extract data.  Often we are
interested in all the probe points in a tapset, such as with
"kernel.syscall.*". But doing that means that we must have an exact list
of the current syscalls in our running kernel, which brings us back to
problem #2 above.

I can think of several possible solutions. Here's one:

Implement a new probe point "kernel.func" which would be like
"kernel.function" except it would just ignore any function that did not
exist in the currently running system. Also it would match inlines.  Add
to the context tapset a function inlined() which would return 1 if the
current probe point was inlined.

So then we could safely do 
probe kernel.func ("sys_*") 

and for tapsets
probe kernel.syscall.get_mempolicy = kernel.func("sys_get_mempolicy")
{...}
probe kernel.syscall.* {...}

This greatly simplifies the maintenance of tapsets because functions get
added and removed from the kernel all the time both because the kernel
changed and because it can be compiled with different options enabled.

Martin




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

end of thread, other threads:[~2006-01-06  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-05  8:45 tapset feedback Martin Hunt
2006-01-05  9:05 ` Roland McGrath
2006-01-05  9:28   ` Martin Hunt
2006-01-05 11:17     ` Roland McGrath
2006-01-05 16:26       ` Martin Hunt
2006-01-05 17:06         ` Frank Ch. Eigler
2006-01-06  9:41         ` Roland McGrath
2006-01-06  9:45         ` 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).