lkml.org 
[lkml]   [2006]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Linux Kernel Markers 0.2 for Linux 2.6.17
Hi -

> > [...] For the static part of the instrumentation, a
> > marker that could be hooked up to either type of probing system was
> > desirable, which implies some sort of run-time changeability.
>
> Ok. So if I get what you're saying here, you'd like to be able to
> overload a marker?

Sort of. Remember, we discussed markers as *marking* places and
things, with the intent that they be decoupled from the actual
*action* that is taken when the marker is hit.

> Can you suggest a macro that can do what you'd like. [...]

Compare the kind of marker I showed at OLS and presently supported by
systemtap. Its unparametrized version looks like this:

#define STAP_MARK(name) do { \
static void (*__mark_##name##_)(); \
if (unlikely (__mark_##name##_)) \
(void) (__mark_##name##_()); \
} while (0)

A tracing/probing tool would hook up to a particular and specific
marker at run time by locating the __mark_NAME static variable (a
function pointer) in the data segment, for example using the ordinary
symbol table, and swapping into it the address of a compatible
back-end handler function. When a particular tracing/probing session
ends, the function pointer is reset to null.

Note that this technique:

- operates at run time
- is portable
- in its parametrized variants, is type-safe
- does not require any future technology
- does impose some overhead even when a marker is not active


- FChE
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-09-20 15:23    [W:0.040 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site