[lttng-dev] Question about filtering bytecode

Jérémie Galarneau jeremie.galarneau at efficios.com
Thu Jul 18 12:10:50 EDT 2013


Hi Amit,

You may find information on the Babeltrace API in babeltrace/doc/API.txt
The filtering mechanism used by the user space tracer is unrelated to
Babeltrace.

As for the sequence of events, this is how I understand it.

When invoking the "lttng" binary with --enable-event and a filter
option, a byte code is generated from the filtering rules
(lttng-tools/src/lib/lttng-ctl/lttng-ctl.c:704). This byte code is
then handed off to the session-daemon.

Then, when an instrumented application is launched and connects to the
session-daemon, it receives the byte code while its events are being
enabled. To answer your question directly, that byte code will be
executed by the tracee when the event is "triggered"
(lttng-ust/liblttng-ust/lttng-filter-interpreter.c:175).

I'm not sure I understand your question about filter/event linking. A
filter has to be linked to an event since its rules (expressions) are
applied on that event's values. Could you clarify if that's not what
you meant?

Regards,
Jérémie

On Thu, Jul 18, 2013 at 3:12 AM, Amit Margalit <AMITM at il.ibm.com> wrote:
> Hi,
>
> I'm considering whether I can write a wrapper for the libbabeltrace ctf
> iterator which provides a filtered "next()" method.
>
> I've started reading the code in the hopes of understanding how to do this,
> and yet, I'd really appreciate a link to some ordered documentation, or -
> any other kind of explanation.
>
> For example, one thing I still don't understand is the exact sequence, and
> where the bytecode is actually executed? What is the meaning and purpose of
> "linking" the filter to an event.
>
> Thanks,
>
> Amit Margalit
> IBM XIV - Storage Reinvented
> XIV-NAS Development Team
> Tel. 03-689-7774
> Fax. 03-689-7230
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list