Re: [patch 3/4] Linux Kernel Markers - Documentation

From: Mathieu Desnoyers
Date: Fri Aug 17 2007 - 11:57:08 EST


* Frank Ch. Eigler (fche@xxxxxxxxxx) wrote:
>
> Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx> writes:
>
> > [...]
> > +A marker placed in your code provides a hook to call a function (probe) that
> > +you can provide at runtime. A marker can be "on" (a probe is connected to it)
> > +or "off" (no probe is attached). When a marker is "off" it has no
> > +effect. [...]
>
> Add something like, ", except for a (how?) small time/space penalty."
>

Yup, good idea. I plan to add:

When a marker is "off" it has no effect, except for adding a tiny time
penality (checking a condition for a branch) and space penality (adding
a few bytes for the function call at the end of the instrumented
function and adds a data structure in a separate section). The
immediate values are used to minimize the impact on data cache, encoding
the condition in the instruction stream.

> > +[...]
> > +trace_mark(subsystem_event, "%d %s", someint, somestring);
> > +Where :
> > +- subsystem_event is an identifier unique to your event
> > + - subsystem is the name of your subsystem.
> > + - event is the name of the event to mark.
> > +[...]
>
> It would be useful to clarify that this "subsystem_event" scheme is
> only a suggested naming convention intended to limit collisions.
>

Sure. Adding:

The naming scheme "subsystem_event" is suggested here as a convention
intended to limit collisions.



> > +Connecting a function (probe) to a marker is done by providing a
> > probe +(function to call) for the specific marker through
> > marker_probe_register() and +can be activated by calling
> > marker_arm().
>
> It would help to spell out the nature of the marker namespace. Is it
> global to the kernel? Per-module? Are conflicting "subsystem_event"
> names but different format strings considered separate markers?
>

What do you think of :

Marker names are global to the kernel: they are considered as being the
same whether they are in the core kernel image or in modules.
Conflicting format strings for markers with the same name will cause the
markers to be detected to have a different format string not to be armed
and will output a printk warning which identifies the inconsistency:

"Format mismatch for probe probe_name (format), marker (format)"



> > + [...] Marker disactivation [...]
>
> "deactivation"
>

Thanks for the review,

Mathieu


> - FChE

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/