Skip to content

Commit 486df34

Browse files
glemcorostedt
authored andcommitted
tracing: Fix DECLARE_TRACE_CONDITION
Commit 287050d ("tracing: Add TRACE_EVENT_CONDITIONAL()") adds macros to define conditional trace events (TRACE_EVENT_CONDITIONAL) and tracepoints (DECLARE_TRACE_CONDITION), but sets up functionality for direct use only for the former. Add preprocessor bits in define_trace.h to allow usage of DECLARE_TRACE_CONDITION just like DECLARE_TRACE. Cc: Mathieu Desnoyers <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Juri Lelli <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 287050d ("tracing: Add TRACE_EVENT_CONDITIONAL()") Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Reviewed-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Gabriele Monaco <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent a065bbf commit 486df34

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/trace/define_trace.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
#define DECLARE_TRACE(name, proto, args) \
7777
DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
7878

79+
#undef DECLARE_TRACE_CONDITION
80+
#define DECLARE_TRACE_CONDITION(name, proto, args, cond) \
81+
DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
82+
7983
/* If requested, create helpers for calling these tracepoints from Rust. */
8084
#ifdef CREATE_RUST_TRACE_POINTS
8185
#undef DEFINE_RUST_DO_TRACE
@@ -108,6 +112,8 @@
108112
/* Make all open coded DECLARE_TRACE nops */
109113
#undef DECLARE_TRACE
110114
#define DECLARE_TRACE(name, proto, args)
115+
#undef DECLARE_TRACE_CONDITION
116+
#define DECLARE_TRACE_CONDITION(name, proto, args, cond)
111117

112118
#ifdef TRACEPOINTS_ENABLED
113119
#include <trace/trace_events.h>
@@ -129,6 +135,7 @@
129135
#undef DEFINE_EVENT_CONDITION
130136
#undef TRACE_HEADER_MULTI_READ
131137
#undef DECLARE_TRACE
138+
#undef DECLARE_TRACE_CONDITION
132139

133140
/* Only undef what we defined in this file */
134141
#ifdef UNDEF_TRACE_INCLUDE_FILE

0 commit comments

Comments
 (0)