lttng-ctl: add event expression API
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 31 Mar 2020 01:23:25 +0000 (21:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 Mar 2021 19:39:08 +0000 (14:39 -0500)
commit48c475643635d97d56fc251ca0b54e67ff25a51f
tree441ef59fb7f48b2c2df74455a76945860bda7864
parent6f9f5cd0134460ad499ce753ff4886440b0b8a0f
lttng-ctl: add event expression API

This new API having the prefix `lttng_event_expr` makes it possible to
create event expressions.

An event expression is an expression which can be evaluated by an LTTng
when an event occurs. An LTTng event filter expression, for example, is
an event expression, although the current interface to specify an event
filter expression is to use the string version, while this new API
offers functions to build an expression tree.

Currently, the event expressions API offers functions to create the
following types of expressions:

Event payload field expression:
    The named payload field of an event.

    Equivalent CLI string example:

        next_prio

Channel context field:
    The named per-channel context field of an event.

    Equivalent CLI string example:

        $ctx.vpid

Application-specific context field:
    The named application-specific context field of an event.

    Equivalent CLI string example:

        $app.iga:active-clients

Array field element:
    The element of an array field.

    Equivalent CLI string examples:

        my_field[4]

        $ctx.some_context[5]

The attentive reader will have discovered that you cannot create all the
expressions needed to create any supported filter expression. This is
because the goal of this patch is to pave the way for the capture
descriptor feature of notify trigger actions, which, for the moment,
only need the expressions above. However, the event expression API can
be extended to support all the filtering subexpressions in the future.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I34770fa8900f0bfb90bb2cbf4a7de59a1645b738
Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479
include/Makefile.am
include/lttng/event-expr-internal.h [new file with mode: 0644]
include/lttng/event-expr.h [new file with mode: 0644]
include/lttng/lttng.h
src/lib/lttng-ctl/Makefile.am
src/lib/lttng-ctl/event-expr.c [new file with mode: 0644]
This page took 0.025436 seconds and 4 git commands to generate.