diff options
author | Yafang Shao <laoar.shao@gmail.com> | 2019-03-26 08:13:09 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-04-08 09:22:51 -0400 |
commit | 163363455b42a1cf833742177149d1352dfe673e (patch) | |
tree | 456d1d7fcd0b6e960f192ee1f25d193de68db280 /include/linux/tracepoint.h | |
parent | a8d655792a32312f6715ac789b860fee50168106 (diff) |
tracing: introduce TRACE_EVENT_NOP()
Sometimes we want to define a tracepoint as a do-nothing function.
So I introduce TRACE_EVENT_NOP, DECLARE_EVENT_CLASS_NOP and
DEFINE_EVENT_NOP for this kind of usage.
Link: http://lkml.kernel.org/r/1553602391-11926-2-git-send-email-laoar.shao@gmail.com
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/tracepoint.h')
-rw-r--r-- | include/linux/tracepoint.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 9c3186578ce0..86b019aa2839 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -548,4 +548,19 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) | |||
548 | 548 | ||
549 | #define TRACE_EVENT_PERF_PERM(event, expr...) | 549 | #define TRACE_EVENT_PERF_PERM(event, expr...) |
550 | 550 | ||
551 | #define DECLARE_EVENT_NOP(name, proto, args) \ | ||
552 | static inline void trace_##name(proto) \ | ||
553 | { } \ | ||
554 | static inline bool trace_##name##_enabled(void) \ | ||
555 | { \ | ||
556 | return false; \ | ||
557 | } | ||
558 | |||
559 | #define TRACE_EVENT_NOP(name, proto, args, struct, assign, print) \ | ||
560 | DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args)) | ||
561 | |||
562 | #define DECLARE_EVENT_CLASS_NOP(name, proto, args, tstruct, assign, print) | ||
563 | #define DEFINE_EVENT_NOP(template, name, proto, args) \ | ||
564 | DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args)) | ||
565 | |||
551 | #endif /* ifdef TRACE_EVENT (see note above) */ | 566 | #endif /* ifdef TRACE_EVENT (see note above) */ |