[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241122171323.1dd0efc9@gandalf.local.home>
Date: Fri, 22 Nov 2024 17:13:23 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Andrii Nakryiko <andrii@...nel.org>, Colin Ian King
<colin.i.king@...il.com>, Jeff Xie <jeff.xie@...ux.dev>, Jinjie Ruan
<ruanjinjie@...wei.com>, Josh Poimboeuf <jpoimboe@...nel.org>, Justin Stitt
<justinstitt@...gle.com>, Levi Yun <yeoreum.yun@....com>, Li Chen
<chenl311@...natelecom.cn>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Ryan Roberts <ryan.roberts@....com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>, Tatsuya S
<tatsuya.s2862@...il.com>, Uros Bizjak <ubizjak@...il.com>, Zheng Yejian
<zhengyejian@...weicloud.com>, guoweikang <guoweikang.kernel@...il.com>
Subject: Re: [GIT PULL] tracing: Updates for v6.13
On Fri, 22 Nov 2024 13:54:49 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> And yes, it's a static conditional, but it's *STUPID*. And it makes
> the code just harder to follow, for no good reason. The difference is
> literally this magic
>
> __DO_TRACE(name, \
> TP_ARGS(args), \
> TP_CONDITION(cond), 0); \
>
> vs
>
> __DO_TRACE(name, \
> TP_ARGS(args), \
> TP_CONDITION(cond), 1); \
Hmm, if we make a __DO_TRACE_SYSCALL(), I don't think it needs to even have
that condition parameter. The TP_CONDITION() is to allow tracepoints to
check a condition within the static_branch() portion of the tracepoint so
the condition does not get called when tracepoints are disabled (and just a
nop). By default we have:
#define DECLARE_TRACE_SYSCALL(name, proto, args) \
__DECLARE_TRACE_SYSCALL(name, PARAMS(proto), PARAMS(args), \
cpu_online(raw_smp_processor_id()), \
PARAMS(void *__data, proto))
Where the tracepoint has to at least be called when the current CPU is
online. But is there every a case where a CPU is not online when a system
call is entered or exited?
And there isn't any use cases of calling the system call tracepoint with a
condition. Hence, I think the __DO_TRACE_SYSCALL() doesn't even need to
include the condition:
#define __DO_TRACE_SYSCALL(name, args) \
do { \
int __maybe_unused __idx = 0; \
Oh, also the __idx isn't used since I removed the SRCU, so we can remove
that too. Maybe make that a separate patch?
rcu_read_lock_trace(); \
\
__DO_TRACE_CALL(name, TP_ARGS(args)); \
\
rcu_read_unlock_trace(); \
} while (0)
-- Steve
Powered by blists - more mailing lists