X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Fust%2Ftracepoint.h;h=e39a3849bc8b928bc7aaff2e5d4f5192eb300a5b;hb=b5a3dfa5923801ddeea22ce70758d1e61200eac2;hp=e7c6b198bc464bde94990623df48912b4af51a68;hpb=e9f37b4cb3e2485b949083307aadfc4bda56ce96;p=lttng-ust.git diff --git a/include/ust/tracepoint.h b/include/ust/tracepoint.h index e7c6b198..e39a3849 100644 --- a/include/ust/tracepoint.h +++ b/include/ust/tracepoint.h @@ -28,6 +28,10 @@ #include #include +#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)\ @@ -413,4 +416,8 @@ static void __attribute__((destructor)) __tracepoints__destroy(void) #endif /* #ifndef TRACEPOINT_LOGLEVEL */ +#ifdef __cplusplus +} +#endif + #endif /* _UST_TRACEPOINT_H */