tracepoint: validate provider/event name length with static assert
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Apr 2021 21:26:32 +0000 (17:26 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Apr 2021 13:22:02 +0000 (09:22 -0400)
commit81b16412749579b79a4d829ff87e170d0e1ebd0d
tree819134a146af56c477dd302646f76d580348f5ff
parent0b4b88119eced28c0cd4fcec773f76525103ac3f
tracepoint: validate provider/event name length with static assert

Validate the provider/event name length with static assert in both
_DEFINE_TRACEPOINT() and within the tracepoint probe.

Validating the length in _DEFINE_TRACEPOINT() ensures that the
tracepoints don't try to register a callsite with a too long name by
mistake. This will enable handling of too long names with rejection of
the tracepoint rather than truncation of the name in a future patch.

The tracepoint probe was already validating the length, but using a
static assert makes the error message clearer.

Introduce LTTNG_UST_TRACEPOINT_NAME_LEN_MAX which is separate from the
communication protocol's LTTNG_UST_ABI_SYM_NAME_LEN to ensure both
communication protocol and instrumentation API can evolve independently.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ia2e9898ef2f7a5708c692476aff7df6113bccb90
include/lttng/tracepoint.h
include/lttng/ust-tracepoint-event.h
src/lib/lttng-ust-tracepoint/tracepoint.c
This page took 0.024904 seconds and 4 git commands to generate.