Refactoring: tracepoint: allow explicit tracepoint instance provider name
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 May 2021 19:04:38 +0000 (15:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 May 2021 15:12:19 +0000 (11:12 -0400)
commit5b675300cd432c3dff378ac5b78eb6b56d4294e6
treeb32e1e9c02fb2f65568c1b7906203cd2f58e6bc2
parent6ed05973463c75c8d36273f6d32764fb761de199
Refactoring: tracepoint: allow explicit tracepoint instance provider name

Add a template_provider argument to LTTNG_UST_TRACEPOINT_EVENT_INSTANCE
to allow a tracepoint instance to refer to a tracepoint class from
another provider within the same compile unit.

Also introduce struct lttng_ust_tracepoint_class to clearly split the
event instance from the class, thus allowing the event instance to refer
to the class through a single symbol. This removes the need to rely on
LTTNG_UST__TP_ARRAY_SIZE() to calculate the size of the event field
array (part of the class) from within the event instance. This
refactoring opens the door to have event class and instance not only in
different providers, but also in providers emitted within different
compile units and shared objects in the future.

For instance, if a .c includes the following headers:

 #define LTTNG_UST_TRACEPOINT_CREATE_PROBES
 #include "a.h"
 #include "b.h"

where a.h contains:

LTTNG_UST_TRACEPOINT_EVENT_CLASS(a, myclass,
        LTTNG_UST_TP_ARGS(int, anint),
        LTTNG_UST_TP_FIELDS(
                lttng_ust_field_integer(int, intfield, anint)
        )
)

and b.h contains:

LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(a, myclass,
        b, myeventinstance,
        LTTNG_UST_TP_ARGS(int, anint)
)

This is a localized API-breaking change introduced very early in the
2.13-rc cycle.

This changes the ABI exposed by the probe providers, so bump the probe
provider major version, and make newer lttng-ust reject old incompatible
major. We can do this because it is very early in the 2.13-rc cycle.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Icf25dc950e483719a26785cd17be9f3d113f7237
include/lttng/tp/lttng-ust-tracelog.h
include/lttng/tracepoint-event.h
include/lttng/tracepoint.h
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event-reset.h
include/lttng/ust-tracepoint-event.h
src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.h
src/lib/lttng-ust/lttng-bytecode-specialize.c
src/lib/lttng-ust/lttng-bytecode.c
src/lib/lttng-ust/lttng-events.c
src/lib/lttng-ust/lttng-probes.c
This page took 0.026894 seconds and 4 git commands to generate.