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
This page took 0.027965 seconds and 4 git commands to generate.