Support c++ tracepoint instrumentation
[ust.git] / include / ust / tracepoint.h
index e7c6b198bc464bde94990623df48912b4af51a68..c484353dc28ffbc2475cc35e24b676f074bfc3bb 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();                                      \
@@ -413,4 +417,8 @@ static void __attribute__((destructor)) __tracepoints__destroy(void)
 
 #endif /* #ifndef TRACEPOINT_LOGLEVEL */
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _UST_TRACEPOINT_H */
This page took 0.023138 seconds and 4 git commands to generate.