Warning cleanup: add missing padding initializer
[lttng-ust.git] / include / lttng / tracepoint.h
index 0629af23e67e21f121478e1da3cbaff869c249e6..66e2abd7c505a296389c4bc691a809eed4c8b812 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <lttng/tracepoint-types.h>
 #include <lttng/tracepoint-rcu.h>
 #include <urcu/compiler.h>
 #include <dlfcn.h>     /* for dlopen */
 #include <string.h>    /* for memset */
-#include <assert.h>
 #include <lttng/ust-config.h>  /* for sdt */
 #include <lttng/ust-compiler.h>
 
@@ -144,11 +145,16 @@ extern "C" {
 #define _TP_ARGS_DATA_VAR(...)         _TP_DATA_VAR_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__)
 #define _TP_PARAMS(...)                        __VA_ARGS__
 
+/*
+ * The tracepoint cb is marked always inline so we can distinguish
+ * between caller's ip addresses within the probe using the return
+ * address.
+ */
 #define _DECLARE_TRACEPOINT(_provider, _name, ...)                                     \
 extern struct tracepoint __tracepoint_##_provider##___##_name;                         \
-static inline lttng_ust_notrace                                                                \
+static inline __attribute__((always_inline)) lttng_ust_notrace                         \
 void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__));             \
-static inline                                                                          \
+static                                                                                 \
 void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__))              \
 {                                                                                      \
        struct tracepoint_probe *__tp_probe;                                            \
@@ -289,7 +295,10 @@ __tracepoints__destroy(void)
                return;
        if (tracepoint_dlopen.liblttngust_handle && !__tracepoint_ptrs_registered) {
                ret = dlclose(tracepoint_dlopen.liblttngust_handle);
-               assert(!ret);
+               if (ret) {
+                       fprintf(stderr, "Error (%d) in dlclose\n", ret);
+                       abort();
+               }
                memset(&tracepoint_dlopen, 0, sizeof(tracepoint_dlopen));
        }
 }
@@ -343,6 +352,7 @@ extern struct tracepoint * const __stop___tracepoints_ptrs[]
                        NULL,                                                   \
                        _TRACEPOINT_UNDEFINED_REF(_provider),                   \
                        _TP_EXTRACT_STRING(_args),                              \
+                       { },                                                    \
                };                                                              \
        static struct tracepoint * __tracepoint_ptr_##_provider##___##_name     \
                __attribute__((used, section("__tracepoints_ptrs"))) =          \
@@ -389,7 +399,10 @@ __tracepoints__ptrs_destroy(void)
                tracepoint_dlopen.tracepoint_unregister_lib(__start___tracepoints_ptrs);
        if (tracepoint_dlopen.liblttngust_handle && !__tracepoint_registered) {
                ret = dlclose(tracepoint_dlopen.liblttngust_handle);
-               assert(!ret);
+               if (ret) {
+                       fprintf(stderr, "Error (%d) in dlclose\n", ret);
+                       abort();
+               }
                memset(&tracepoint_dlopen, 0, sizeof(tracepoint_dlopen));
        }
 }
This page took 0.023775 seconds and 4 git commands to generate.