Skip to content

Commit ef0d418

Browse files
compudjrostedt
authored andcommitted
tracing: Remove cond argument from __DECLARE_TRACE_SYSCALL
Syscall tracepoints do not require a "cond" argument, because they are meant to be used only for sys_enter and sys_exit instrumentation, which don't require condition evaluation. Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Michael Jeanson <mjeanson@efficios.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Yonghong Song <yhs@fb.com> Cc: Paul E. McKenney <paulmck@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com> Cc: bpf@vger.kernel.org Cc: Joel Fernandes <joel@joelfernandes.org> Cc: Jordan Rife <jrife@google.com> Cc: linux-trace-kernel@vger.kernel.org Link: https://lore.kernel.org/20241123153031.2884933-6-mathieu.desnoyers@efficios.com Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 98bf0fb commit ef0d418

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

include/linux/tracepoint.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
220220
* site if it is not watching, as it will need to be active when the
221221
* tracepoint is enabled.
222222
*/
223-
#define __DECLARE_TRACE_COMMON(name, proto, args, cond, data_proto) \
223+
#define __DECLARE_TRACE_COMMON(name, proto, args, data_proto) \
224224
extern int __traceiter_##name(data_proto); \
225225
DECLARE_STATIC_CALL(tp_func_##name, __traceiter_##name); \
226226
extern struct tracepoint __tracepoint_##name; \
@@ -254,7 +254,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
254254
}
255255

256256
#define __DECLARE_TRACE(name, proto, args, cond, data_proto) \
257-
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), cond, PARAMS(data_proto)) \
257+
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto)) \
258258
static inline void trace_##name(proto) \
259259
{ \
260260
if (static_branch_unlikely(&__tracepoint_##name.key)) { \
@@ -269,18 +269,16 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
269269
} \
270270
}
271271

272-
#define __DECLARE_TRACE_SYSCALL(name, proto, args, cond, data_proto) \
273-
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), cond, PARAMS(data_proto)) \
272+
#define __DECLARE_TRACE_SYSCALL(name, proto, args, data_proto) \
273+
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto)) \
274274
static inline void trace_##name(proto) \
275275
{ \
276276
might_fault(); \
277277
if (static_branch_unlikely(&__tracepoint_##name.key)) { \
278-
if (cond) { \
279-
scoped_guard(rcu_tasks_trace) \
280-
__DO_TRACE_CALL(name, TP_ARGS(args)); \
281-
} \
278+
scoped_guard(rcu_tasks_trace) \
279+
__DO_TRACE_CALL(name, TP_ARGS(args)); \
282280
} \
283-
if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \
281+
if (IS_ENABLED(CONFIG_LOCKDEP)) { \
284282
WARN_ONCE(!rcu_is_watching(), \
285283
"RCU not watching for tracepoint"); \
286284
} \
@@ -363,7 +361,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
363361

364362

365363
#else /* !TRACEPOINTS_ENABLED */
366-
#define __DECLARE_TRACE(name, proto, args, cond, data_proto) \
364+
#define __DECLARE_TRACE_COMMON(name, proto, args, data_proto) \
367365
static inline void trace_##name(proto) \
368366
{ } \
369367
static inline int \
@@ -387,7 +385,11 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
387385
return false; \
388386
}
389387

390-
#define __DECLARE_TRACE_SYSCALL __DECLARE_TRACE
388+
#define __DECLARE_TRACE(name, proto, args, cond, data_proto) \
389+
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto))
390+
391+
#define __DECLARE_TRACE_SYSCALL(name, proto, args, data_proto) \
392+
__DECLARE_TRACE_COMMON(name, PARAMS(proto), PARAMS(args), PARAMS(data_proto))
391393

392394
#define DEFINE_TRACE_FN(name, reg, unreg, proto, args)
393395
#define DEFINE_TRACE_SYSCALL(name, reg, unreg, proto, args)
@@ -453,7 +455,6 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
453455

454456
#define DECLARE_TRACE_SYSCALL(name, proto, args) \
455457
__DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args), \
456-
cpu_online(raw_smp_processor_id()), \
457458
PARAMS(void *__data, proto))
458459

459460
#define TRACE_EVENT_FLAGS(event, flag)

0 commit comments

Comments
 (0)