[lttng-dev] [PATCH lttng-ust] Add 'unused' attribute to tracepoint callback

Zifei Tong zifeitong at gmail.com
Fri Mar 14 09:20:45 EDT 2014


Compiling tracepoint provider with clang generates 'Wunused-function'
warnings. Add 'unused' attribute to silence these warnings.

Fixes #760

Signed-off-by: Zifei Tong <zifeitong at gmail.com>
---
 include/lttng/tracepoint.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h
index 66e2abd..c5a09d8 100644
--- a/include/lttng/tracepoint.h
+++ b/include/lttng/tracepoint.h
@@ -152,7 +152,7 @@ extern "C" {
  */
 #define _DECLARE_TRACEPOINT(_provider, _name, ...)			 		\
 extern struct tracepoint __tracepoint_##_provider##___##_name;				\
-static inline __attribute__((always_inline)) lttng_ust_notrace				\
+static inline __attribute__((always_inline, unused)) lttng_ust_notrace			\
 void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__));		\
 static											\
 void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__))		\
-- 
1.9.0




More information about the lttng-dev mailing list