Support c++ tracepoint instrumentation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2011 23:55:32 +0000 (19:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2011 23:55:32 +0000 (19:55 -0400)
Applications can be built with g++, but tracepoint probes need to be
built with gcc.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/ust/marker.h
include/ust/tracepoint.h
include/ust/ust.h
tests/hello/ust_tests_hello.h

index e8608a96b2c700740b09378ef517c3562be1b780..8cfdcbdb54057ee16813a432ac83e69ab6df12ef 100644 (file)
 #include <bits/wordsize.h>
 #include <urcu/list.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ust_marker;
 struct ust_marker_probe_array;
 
@@ -218,4 +222,8 @@ void __MARKER_LIB_IS_DEPRECATED()
  */
 #define MARK_NOARGS    UST_MARKER_NOARGS
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _UST_MARKER_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 */
index 16cd475cd2ad72988128d181aa0e6caf42cd6159..593598b42dc27a7ba599426ad5f2567bd35b31c3 100644 (file)
 #ifndef _UST_H
 #define _UST_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct ust_fork_info {
        sigset_t orig_sigs;
 } ust_fork_info_t;
@@ -28,4 +32,8 @@ extern void ust_before_fork(ust_fork_info_t *fork_info);
 extern void ust_after_fork_parent(ust_fork_info_t *fork_info);
 extern void ust_after_fork_child(ust_fork_info_t *fork_info);
 
+#ifdef __cplusplus 
+}
+#endif
+
 #endif /* _UST_H */
index 9f6ab9b8ca8f8adf7d20e8e4a67559c835dfaafa..9d78b5dacf42430109a5bdb62f88817478e3a7aa 100644 (file)
@@ -4,6 +4,10 @@
 #if !defined(_TRACEPOINT_UST_TESTS_HELLO_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
 #define _TRACEPOINT_UST_TESTS_HELLO_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Copyright (C) 2011  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
@@ -60,3 +64,7 @@ TRACEPOINT_EVENT_NOARGS(ust_tests_hello_tptest_sighandler,
 
 /* This part must be outside protection */
 #include <ust/tracepoint-event.h>
+
+#ifdef __cplusplus 
+}
+#endif
This page took 0.026494 seconds and 4 git commands to generate.