X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=include%2Flttng%2Ftracepoint.h;h=a224caebcd8485cf731648a0b6ce0e718d8d0bae;hb=5cd29ace704432c7a421f7749ef8591e30e1894c;hp=929a863ffc1e91d17056f3a40e2d9433bfab389b;hpb=df854e41ded4203a5b86bac062b8604bb038759a;p=lttng-ust.git diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 929a863f..a224caeb 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include /* for dlopen */ @@ -113,13 +113,19 @@ extern "C" { #define _TP_ARGS_DATA_VAR(...) _TP_DATA_VAR_N(_TP_NARGS(0, ##__VA_ARGS__), ##__VA_ARGS__) #define _TP_PARAMS(...) __VA_ARGS__ +#ifdef _LGPL_SOURCE +#define _TP_RCU_LINK_TEST() 1 +#else +#define _TP_RCU_LINK_TEST() rcu_read_lock_bp +#endif + #define _DECLARE_TRACEPOINT(provider, name, ...) \ extern struct tracepoint __tracepoint_##provider##___##name; \ static inline void __tracepoint_cb_##provider##___##name(_TP_ARGS_PROTO(__VA_ARGS__)) \ { \ struct tracepoint_probe *__tp_probe; \ \ - if (!rcu_read_lock_bp) \ + if (!_TP_RCU_LINK_TEST()) \ return; \ rcu_read_lock_bp(); \ __tp_probe = rcu_dereference_bp(__tracepoint_##provider##___##name.probes); \