Add lttng_ust_ prefix before objd_unref
[lttng-ust.git] / include / ust / tracepoint.h
index b7c38a2475a56c8de014ed7d5f8a4e6151c68850..e39a3849bc8b928bc7aaff2e5d4f5192eb300a5b 100644 (file)
 #include <urcu-bp.h>
 #include <urcu/list.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct tracepoint_probe {
        void *func;
        void *data;
@@ -61,7 +65,7 @@ struct tracepoint {
                        do {                                            \
                                __tp_it_func = __tp_it_probe_ptr->func; \
                                __tp_cb_data = __tp_it_probe_ptr->data; \
-                               ((void(*)(proto))__tp_it_func)(args);   \
+                               URCU_FORCE_CAST(void(*)(proto), __tp_it_func)(args); \
                        } while ((++__tp_it_probe_ptr)->func);          \
                }                                                       \
                rcu_read_unlock();                                      \
@@ -73,7 +77,7 @@ struct tracepoint {
 
 #define __CHECK_TRACE(name, proto, args)                               \
        do {                                                            \
-               if (unlikely(__tracepoint_##name.state))                \
+               if (caa_unlikely(__tracepoint_##name.state))            \
                        __DO_TRACE(&__tracepoint_##name,                \
                                TP_PROTO(proto), TP_ARGS(args));        \
        } while (0)
@@ -95,7 +99,6 @@ struct tracepoint {
        {                                                               \
                return __tracepoint_probe_register(#name, (void *)probe,\
                                                 data);                 \
-                                                                       \
        }                                                               \
        static inline int                                               \
        __unregister_trace_##name(void (*probe)(data_proto), void *data)\
@@ -392,9 +395,11 @@ static void __attribute__((destructor)) __tracepoints__destroy(void)
  *              TP_LOGLEVEL(LOG_DEBUG,   7)
  *      )
  *
- * 2) Then, declare tracepoint loglevels for tracepoints. The first
- *    field is the name of the tracepoint, the second field is the
- *    loglevel name.
+ * 2) Then, declare tracepoint loglevels for tracepoints. A
+ *    TRACEPOINT_EVENT should be declared prior to the the
+ *    TRACEPOINT_LOGLEVEL for a given tracepoint name. The first field
+ *    is the name of the tracepoint, the second field is the loglevel
+ *    name.
  *
  *      TRACEPOINT_LOGLEVEL(< [com_company_]project_[component_]event >,
  *              < loglevel_name >)
@@ -411,4 +416,8 @@ static void __attribute__((destructor)) __tracepoints__destroy(void)
 
 #endif /* #ifndef TRACEPOINT_LOGLEVEL */
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _UST_TRACEPOINT_H */
This page took 0.024293 seconds and 4 git commands to generate.