Re: [PATCH] Linux Kernel Markers 0.11 for 2.6.17

From: Frank Ch. Eigler
Date: Wed Sep 27 2006 - 12:14:00 EST

Hi -

Mathieu Desnoyers <compudj@xxxxxxxxxxxxxxxxxx> 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
trace-only handler.

> > > 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
> MARK_u_p_llu

I don't know. Using gcc extensions such as __builtin_typeof() could
automate the typing aspect, leaving only the arity as a
programmer-visible text.

> 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.

- FChE
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at