Introduce extension points for trace hit counters
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Jul 2024 21:41:32 +0000 (17:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Jul 2024 20:07:06 +0000 (16:07 -0400)
commit24f7193c9b918bf714a40e9fc908eeb4978ada1c
treef48307968da944c3f4f6e09787823f3c55ff567b
parent1e8023ed96ab3e7f268d82c7028f6b807f1c9175
Introduce extension points for trace hit counters

Introduce two extension points for trace hit counters:

1) Future "actions" to perform other than "increment",

2) Future dimension indexing schemes (keys) other than tokens.

Ensure the LTTng-UST protocol with session daemon has those extension
points so we don't need to break ABI when we need to extend trace hit
counters with those features.

Also ensure the ABI between the tracepoint probe provider and the
tracer passes all the relevant context for future features, e.g.
tracepoint arguments and contexts.

Change the layout of struct lttng_ust_abi_counter_key_dimension
by adding a "key_type" field. A new struct lttng_ust_abi_counter_key_dimension_tokens
inherits from struct lttng_ust_abi_counter_key_dimension, and contains
the uint32_t nr_key_tokens field. The only currently supported key_type
is LTTNG_UST_ABI_KEY_TYPE_TOKENS = 0.

Change the layout of struct lttng_ust_abi_counter_event by adding an
"action" field. The only currently supported action is
LTTNG_UST_ABI_COUNTER_ACTION_INCREMENT = 0.

Change the struct lttng_ust_abi_key_token_string so it inherits from
struct lttng_ust_abi_key_token. The "len" field of
struct lttng_ust_abi_key_token now includes the length of the entire
child structure.

Change the newly introduced ABI between probe providers to change the
"event_counter_add" callback into a "counter_hit" callback, which takes
one less argument (no integer value), but takes additional stack_data,
probe_ctx, and event_counter_ctx arguments for future use.

Introduce a new LTTNG_UST_CTL_NOTIFY_CMD_KEY notification command to
separate key notifications from event notifications, given that they
require different arguments.

Revert back the register event notification to return a 32-bit event ID:
there is no point in changing the pre-existing protocol for event
registration now that key registration gets its own protocol commands.

Note that the protocol major is left at 10 even though we revert the
event ID change, because the protocol was bumped to 10 due to a
different change:

commit f63969cc383c ("dynamic-type: remove underscore prefix from mapping names")

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0ed00dacfdaf333ffad406f8d017ee21bcbc212b
12 files changed:
include/lttng/ust-abi.h
include/lttng/ust-ctl.h
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
src/common/counter-clients/percpu-32-modular.c
src/common/counter-clients/percpu-64-modular.c
src/common/events.h
src/common/ustcomm.c
src/common/ustcomm.h
src/lib/lttng-ust-ctl/ustctl.c
src/lib/lttng-ust/lttng-events.c
src/lib/lttng-ust/lttng-ust-abi.c
This page took 0.025961 seconds and 4 git commands to generate.