From: sashiko-bot@kernel.org
To: "Wenwen Fu" <wenwfu@qti.qualcomm.com>
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: skip boot kprobe setup when no events were requested
Date: Fri, 06 Nov 2026 02:19:58 +0000 [thread overview]
Message-ID: <sashiko-outbox-200586@kernel.org> (raw)
In-Reply-To: <20261106021457.2648231-1-wenwfu@qti.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] tracing: redundant unreachable check in setup_boot_kprobe_events()
--
commit 2a160557ebac2d0dc5d93db740f4d45dcc8bd5e9
Author: Wenwen Fu <wenwfu@qti.qualcomm.com>
tracing: skip boot kprobe setup when no events were requested
This commit adds an early return to setup_boot_kprobe_events() when
kprobe_boot_events_buf is empty to avoid acquiring event_mutex in
enable_boot_kprobe_events() when no boot kprobe events were requested.
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index e41a7c113646b..6e0fff6b4d91f 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -2017,6 +2017,9 @@ static __init void setup_boot_kprobe_events(void)
> char *p, *cmd = kprobe_boot_events_buf;
> int ret;
>
> + if (!kprobe_boot_events_buf[0])
> + return;
[Severity: Medium]
Can this branch in setup_boot_kprobe_events() ever be reached?
In kernel/trace/trace_kprobe.c, init_kprobe_trace() is the sole caller of
setup_boot_kprobe_events(), and it already returns early when
kprobe_boot_events_buf[0] is NUL:
static __init int init_kprobe_trace(void)
{
...
/* If no 'kprobe_event=' cmd is provided, return directly. */
if (kprobe_boot_events_buf[0] == '\0')
return 0;
setup_boot_kprobe_events();
return 0;
}
Furthermore, enable_boot_kprobe_events() also already checks
trace_kprobe_list_empty() before acquiring event_mutex:
static __init void enable_boot_kprobe_events(void)
{
...
if (trace_kprobe_list_empty())
return;
guard(mutex)(&event_mutex);
...
}
Was the check in init_kprobe_trace() meant to be moved into
setup_boot_kprobe_events(), or is this patch redundant with existing checks?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106021457.2648231-1-wenwfu@qti.qualcomm.com?part=1
prev parent reply other threads:[~2026-11-06 2:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 2:14 [PATCH] tracing: skip boot kprobe setup when no events were requested Wenwen Fu
2026-11-06 2:19 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-200586@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wenwfu@qti.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox