This is the mail archive of the
mailing list for the systemtap project.
Re: [PATCH] Linux Kernel Markers 0.11 for 2.6.17
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Mathieu Desnoyers <compudj at krystal dot dyndns dot org>
- Cc: Martin Bligh <mbligh at google dot com>, Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, prasanna at in dot ibm dot com, Andrew Morton <akpm at osdl dot org>, Ingo Molnar <mingo at elte dot hu>, Paul Mundt <lethal at linux-sh dot org>, linux-kernel <linux-kernel at vger dot kernel dot org>, Jes Sorensen <jes at sgi dot com>, Tom Zanussi <zanussi at us dot ibm dot com>, Richard J Moore <richardj_moore at uk dot ibm dot com>, Michel Dagenais <michel dot dagenais at polymtl dot ca>, Christoph Hellwig <hch at infradead dot org>, Greg Kroah-Hartman <gregkh at suse dot de>, Thomas Gleixner <tglx at linutronix dot de>, William Cohen <wcohen at redhat dot com>, ltt-dev at shafik dot org, systemtap at sources dot redhat dot com, Alan Cox <alan at lxorguk dot ukuu dot org dot uk>, Jeremy Fitzhardinge <jeremy at goop dot org>, Karim Yaghmour <karim at opersys dot com>, Pavel Machek <pavel at suse dot cz>, Joe Perches <joe at perches dot com>, "Randy.Dunlap" <rdunlap at xenotime dot net>, "Jose R. Santos" <jrs at us dot ibm dot com>
- Date: 27 Sep 2006 12:12:09 -0400
- Subject: Re: [PATCH] Linux Kernel Markers 0.11 for 2.6.17
- References: <20060925151028.GA14695@Krystal> <20060925160115.GE25296@redhat.com> <20060925232828.GA29343@Krystal> <email@example.com> <20060927013020.GA5171@Krystal>
Mathieu Desnoyers <firstname.lastname@example.org> writes:
> > That involves new conventions beyond printf. Why not "%p %p %u %u"
> > for two blobs ... or why implicitly dereference the given pointers. A
> > probe handler unaware of a specific marker's semantics would not know
> > whether or not this is implied.
> So yes, there is a semantic to create, but I don't see the problem with that.
That's a part of my point. The marker data types marked up with
printf directives do not fully describe the data - in this case
whether it is a raw pointer or a data blob that is being marked.
> And why would the probe actually know what to do with a pointer ? If
> it only wants to record the pointer's address or if it wants to
> access data inside this pointer, it's up to the probe (or automatic
> probe generator, hum ?) to do it.
Of course, but that precludes a general client tool, such as (say) a
> > > I think that duplicating the number of marker macros could easily make
> > > them unflexible and ugly. [...]
> > Inflexible and ugly in what way? [...]
> I don't expect the kernel programmer community to accept that their code will
> call an automatically generated macro. It removes all the idea of "I can see
> what code is actually generated by my function", which I believe is necessary.
Not at all - the generated macros can sit in-tree and are easily
inspected. Check out gen-stapmark.h and stapmark.h at
> Also, people are used to the simplicity and flexibility of printf
> style format strings.
True, but is this in context of the existing tracing/probing
facilities? Unless I'm mistaken, ltt functions doesn't use them; nor
does blktrace. Other than printk, are there any?
> Do you really expect people to start using various macros like
I don't know. Using gcc extensions such as __builtin_typeof() could
automate the typing aspect, leaving only the arity as a
> and start defining their own marker macro each time they want to add
> a specific type ?
Well, adding a new type would be at last as hard in the printf case.
> [...] However, if you want to create probes that are type-safe, you
> can then create a script that will extract all the format strings in
> the markers section of the object and automatically generate all the
> probes with their respective va_args setup at the beginning of the
> probe. [...]
This could work. OTOH this relies on an as-yet-unwritten script, and
additional run-time costs (the parameter-by-parameter va_arg copying).
I wonder if writing a functional back-end for these markers should be
considered a corequisite for this work; or in the alternative, whether
it's good enough to start putting markers into the code, and revamp
their implementation later if necessary.