This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: What is a tapset?
On Thu, 2005-07-21 at 13:16, Frank Ch. Eigler wrote:
> Jim Keniston <jkenisto@us.ibm.com> writes:
>
> > [...]
>
> (Oops, I meant to credit jkenisto within the list of embedded-C
> inspirations.)
You mentioned "and others," so you're covered. :-) I can't remember who
first suggested the %{ ... %} idea.
>
>
> > [...]
> > > I thought joining the two concepts [aliases & prologues] made some
> > > sense. If prologues were a separately declared widget without a
> > > distinct name, then the user would not have a marker in the script
> > > source that tells apart the case where a prologue is being pulled
> > > in vs. one where one's not.
>
> > Since we're trying to be "safe," I assume the author/user of an
> > end-user script will be able to specify which tapset (set of predefined
> > probepoints+prologues) his script refers to. [...]
>
> You mean via an explicit "use" or something? I guess that may be
> possible, but it goes against the philosophy of implicit but
> unambiguous mechanisms.
>
Let's see what develops. We can add the explicit-"use" thing if it
turns out to be desirable.
...
>
>
> > [...]
> > Not one that anyone has bought into, but we're creative. I suggested
> > the ability to name handlers some time ago. [...]
>
> Interesting ideas.
>
> > Then a user could refer to that handler as (say)
> > kernel.syscall("read"):trace instead of having to write his own
> > handler to trace that function.
>
> This is not that different from defining an ordinary (nested) alias:
>
> alias kernel.syscall("read") = ....
> alias kernel.syscall("read").trace = kernel.syscall("read") { print ... }
>
> > You might refer to all handlers named "trace"
> > for all system-call entry points as kernel.syscall(*).entry:trace.
>
> Depending on wildcard matching mechanisms, this could work with
> the existing alias mechanism:
>
> probe kernel.syscall("*").trace { /* empty */ }
So this would have the effect of pulling in the predefined trace() code
-- just like any other "prologue" code -- into an otherwise empty
handler? (Well, in this case, "*" implies pulling a set of predefined
trace() blocks into a corresponding set of handlers.) Works for me.
>
>
> > [...]
> > This syntax could be used in the command line ("Enable the following
> > predefined handlers") on in an .stp file [...]
>
> The command line equivalent could be:
>
> stap -e 'probe kernel.syscall("*").trace {}'
>
> If such empty probe handler bodies become commonplace, we could
> teach the parser to make the body optional.
That'd be nice.
>
>
> - FChE
>
Looks good to me.
Jim