From 70763508d0b92272c408dce9c389739dd0421790 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 10:02:00 -0400 Subject: [PATCH] Clarify probe registration documentation/errors Fixes #513 Signed-off-by: Mathieu Desnoyers --- doc/man/lttng-ust.3 | 5 +++++ include/lttng/ust-tracepoint-event.h | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/man/lttng-ust.3 b/doc/man/lttng-ust.3 index 4e30d762..37b08b22 100644 --- a/doc/man/lttng-ust.3 +++ b/doc/man/lttng-ust.3 @@ -148,6 +148,11 @@ TRACEPOINT_EVENT( ctf_float(double, doublefield, doublearg) ) ) + +There can be an arbitrary number of tracepoint providers within an +application, but they must each have their own provider name. Duplicate +provider names are not allowed. + .fi .SH "ASSIGNING LOGLEVEL TO EVENTS" diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index e46cc1a1..b860504a 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -682,7 +683,10 @@ _TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void) */ _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(); ret = lttng_probe_register(&_TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER)); - assert(!ret); + if (ret) { + fprintf(stderr, "LTTng-UST: Error (%d) while registering tracepoint probe. Duplicate registration of tracepoint probes having the same name is not allowed.\n", ret); + abort(); + } } static void lttng_ust_notrace __attribute__((destructor)) -- 2.34.1