Re: [PATCH 0/11] LTTng-core (basic tracing infrastructure) 0.5.108

Ingo Molnar
2006-09-15T18:20:25Z

* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> Ar Gwe, 2006-09-15 am 13:08 -0400, ysgrifennodd Frank Ch. Eigler:
> > Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > - where 1000-cycle int3-dispatching overheads too high
>
> Why are your despatching overheads 1000 cycles ? (and if its due to
> int3 why are you using int 3 8))

this is being worked on actively: there's the "djprobes" patchset, which
includes a simplified disassembler to analyze common target code and can
thus insert much faster, call-a-trampoline-function based tracepoints
that are just as fast as (or faster than) compile-time, static
tracepoints.

there's no fundamental reason why INT3 should be the primary model of
inserting kprobes. Sometimes we are unlucky and the code which we target
is too complex - then we take a few hundred cycles of a penalty. If that
piece of code is a really common destination then we can add a static
marker in the source which both prepares parameters and inserts a
sufficiently sized NOP (or a function call) to prepare things for fast
dynamic tracing - but it should only be an optional performance helper
that we have the freedom to zap.

(kprobes can be thought of as a special "JIT", and there's no
fundamental reason why it couldnt do almost arbitrary transformations on
kernel code.)

and there's alot more that kprobes/systemtap can do: it can be a method
of extending the kernel along a 'plugin' model - without having to
impact the kernel source! That way people can experiment with kernel
extensions on live kernels, without the barrier of recompile/reboot.

Ingo