From: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
To: mhiramat@kernel.org
Cc: rostedt@goodmis.org, linux-trace-kernel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] tools/bootconfig: Quote command strings when applying ftrace settings
Date: Wed, 28 Oct 2026 20:36:24 +0100 [thread overview]
Message-ID: <97454eceb5d56bf956740b8998972767bcfe6c70.1793216183.git.edumucelli@gmail.com> (raw)
In-Reply-To: <cover.1793216183.git.edumucelli@gmail.com>
run_cmd() passes its command string to eval using an unquoted $*. The
shell performs field splitting and pathname expansion before eval can
parse the quotes in that string.
For example, an event filter prev_comm == "a b" is applied as
prev_comm == "a b". A literal "*" surrounded by spaces inside a filter
can also expand to filenames in the current directory. The printed
command still contains the intended string, so --apply changes the
settings even though the preview looks correct.
Quote "$*" when passing it to eval to preserve the command string. This
fixes both per-event filters and histogram actions.
Fixes: 7e66ef0046cc ("tools/bootconfig: Add a script to generate ftrace shell-command from bootconfig")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
---
I tested this with hand-written configs in a temporary tracefs instance
on my Ubuntu machine, running kernel 7.0.0-38-generic, with recording
disabled. I checked both event filters and histogram action filters.
The original helper collapsed repeated spaces and expanded a literal *
into filenames. With the fix, the strings were preserved. Ordinary
string and numeric filters worked in both versions.
tools/bootconfig/scripts/bconf2ftrace.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bootconfig/scripts/bconf2ftrace.sh b/tools/bootconfig/scripts/bconf2ftrace.sh
index 7745c97e7abd..ea7b17d0d4d7 100755
--- a/tools/bootconfig/scripts/bconf2ftrace.sh
+++ b/tools/bootconfig/scripts/bconf2ftrace.sh
@@ -41,7 +41,7 @@ fi
run_cmd() { # command
echo "$*"
if [ x"$APPLY" != x ]; then # apply command
- eval $*
+ eval "$*"
fi
}
--
2.53.0
prev parent reply other threads:[~2026-10-28 19:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 19:36 [PATCH 0/2] tools/bootconfig: Preserve filters when resetting and applying tracing Eduardo Mucelli Rezende Oliveira
2026-10-28 19:36 ` [PATCH 1/2] tools/bootconfig: Preserve filters when resetting histogram triggers Eduardo Mucelli Rezende Oliveira
2026-10-28 19:36 ` Eduardo Mucelli Rezende Oliveira [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=97454eceb5d56bf956740b8998972767bcfe6c70.1793216183.git.edumucelli@gmail.com \
--to=edumucelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®