Clarify probe registration documentation/errors
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 18 Jun 2013 14:02:00 +0000 (10:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 18 Jun 2013 14:04:47 +0000 (10:04 -0400)
Fixes #513

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/man/lttng-ust.3
include/lttng/ust-tracepoint-event.h

index 9bad1ecbede318be85d5505bce2da0db85221cdd..0de6b6a1e9e1d1bccee7bce37e964cb25d15e62a 100644 (file)
@@ -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"
index 5f687090234d9540d5e983b31493478e2935d3bc..f52ae961d12a3c9187a66d39f56f8c4212f976d1 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <urcu/compiler.h>
 #include <lttng/ust-events.h>
 #include <lttng/ringbuffer-config.h>
@@ -560,8 +561,10 @@ _TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void)
         * error will appear.
         */
        _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)();
-       ret = ltt_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 __attribute__((destructor))
This page took 0.025841 seconds and 4 git commands to generate.