mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
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>
This commit is contained in:
parent
a8d655792a
commit
163363455b
2 changed files with 23 additions and 0 deletions
|
@ -548,4 +548,19 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
|
|||
|
||||
#define TRACE_EVENT_PERF_PERM(event, expr...)
|
||||
|
||||
#define DECLARE_EVENT_NOP(name, proto, args) \
|
||||
static inline void trace_##name(proto) \
|
||||
{ } \
|
||||
static inline bool trace_##name##_enabled(void) \
|
||||
{ \
|
||||
return false; \
|
||||
}
|
||||
|
||||
#define TRACE_EVENT_NOP(name, proto, args, struct, assign, print) \
|
||||
DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args))
|
||||
|
||||
#define DECLARE_EVENT_CLASS_NOP(name, proto, args, tstruct, assign, print)
|
||||
#define DEFINE_EVENT_NOP(template, name, proto, args) \
|
||||
DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args))
|
||||
|
||||
#endif /* ifdef TRACE_EVENT (see note above) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue