From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: Masami Hiramatsu <mhiramat@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Shuah Khan <shuah@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v3 4/5] tracing/probes: Extend max length of argument string
Date: Fri, 24 Jul 2026 10:33:17 +0800 [thread overview]
Message-ID: <20260724023317.624074-1-zhanxusheng@xiaomi.com> (raw)
In-Reply-To: <178399140457.27810.11387684872148824707.stgit@devnote2>
On Tue, Jul 14, 2026 at 10:10:04AM +0900, Masami Hiramatsu (Google) wrote:
> - char buf[MAX_ARGSTR_LEN + 1];
> + char buf[MAX_COMMON_HEAD_LEN + 1];
> ...
> +#define MAX_ARGSTR_LEN 255
> +#define MAX_COMMON_HEAD_LEN 63
Keeping the head buffer at 63 avoids growing it to 256, but it also
preserves a pre-existing truncation of the kprobe/fprobe head: both
trace_kprobe_match_command_head() and trace_fprobe_match_command_head()
snprintf() the symbol / function name into this buffer ("%s" or "%s+%u").
Kernel symbols can be far longer than 63 -- Rust-mangled names are
routinely 150-200+ chars (KSYM_NAME_LEN is 512); I see 199-char symbols
in /proc/kallsyms here.
This is the same delete-/match-by-command path you just fixed for the
args matcher in commit 15f197856d68 ("tracing/probes: Avoid temporary
buffer truncation in trace_probe_match_command_args()"):
dyn_event_release() passes the symbol as argv[0] to
*_match_command_head(), which then calls trace_probe_match_command_args().
The head runs first, so for a probe on a long symbol the head strcmp()
already fails and the probe cannot be matched/deleted by full command --
before the args fix is even reached.
Would it make sense to give the head matchers the same direct-comparison
treatment instead of a fixed buffer -- compare the symbol (and optional
"+offset") against argv[0] directly? uprobe already compares its filename
directly, so mainly kprobe and fprobe would need it, and
MAX_COMMON_HEAD_LEN could then be dropped.
Thanks,
Xusheng
next prev parent reply other threads:[~2026-07-24 2:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 1:09 [PATCH v3 0/5] tracing/probes: Clean up and refactor argument parser Masami Hiramatsu (Google)
2026-07-14 1:09 ` [PATCH v3 1/5] tracing/probes: Refactor parse_probe_vars() Masami Hiramatsu (Google)
2026-07-14 1:09 ` [PATCH v3 2/5] tracing/probes: Refactor parse_probe_arg() Masami Hiramatsu (Google)
2026-07-14 1:09 ` [PATCH v3 3/5] tracing/probes: Sort ERRORS list in trace_probe.h alphabetically Masami Hiramatsu (Google)
2026-07-14 1:10 ` [PATCH v3 4/5] tracing/probes: Extend max length of argument string Masami Hiramatsu (Google)
2026-07-24 2:33 ` Zhan Xusheng [this message]
2026-07-14 1:10 ` [PATCH v3 5/5] tracing/probes: Eliminate recursion in parse_probe_arg() Masami Hiramatsu (Google)
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=20260724023317.624074-1-zhanxusheng@xiaomi.com \
--to=zhanxusheng1024@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
/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