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/5] tools/bootconfig: Preserve quotes in exported event actions
Date: Sat, 31 Oct 2026 19:35:31 +0100 [thread overview]
Message-ID: <001ad0e960ea349b3a5de670944c28853224c0ec.1793471731.git.edumucelli@gmail.com> (raw)
In-Reply-To: <cover.1793471731.git.edumucelli@gmail.com>
Reading complete trigger lines preserves filters that can contain single
quotes. Enclosing every action in single bootconfig quotes then produces
invalid output for a valid trigger such as traceoff if prev_comm == 'abc'.
Use double quotes for actions containing only single quotes. Actions with
both quote types can be emitted without enclosing quotes when they have
no bootconfig delimiters. Warn and skip unrepresentable actions containing
both quote types and delimiters, following the event-filter handling.
Fixes: 6a5740440c47 ("tools/bootconfig: Preserve event trigger filters in ftrace2bconf.sh")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
---
I reproduced this with valid traceoff triggers using single-quoted
filters in a temporary tracefs instance on my Ubuntu machine, running
kernel 7.0.0-38-generic, with recording disabled.
The original export failed bootconfig parsing. With the fix, supported
single-quoted actions parsed and their decoded commands could be
restored unchanged to tracefs. Unrepresentable mixed-quote actions
produced a warning and were skipped. Mixed quotes without delimiters
and ordinary double-quoted filters were checked as well.
tools/bootconfig/scripts/ftrace2bconf.sh | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh
index 31702be0c68d..77ec17c94a17 100755
--- a/tools/bootconfig/scripts/ftrace2bconf.sh
+++ b/tools/bootconfig/scripts/ftrace2bconf.sh
@@ -126,7 +126,22 @@ per_event_options() { # event-dir
*:count=*)
action="${action_cmd%:count=*}:${action_cmd##*:count=}$action_rest";;
esac
- emit_kv $PREFIX.event.$group.$event.actions += "'$action'"
+ case "$action" in
+ *\'*)
+ case "$action" in
+ *\"*)
+ case "$action" in
+ *[,\;\#\}]*)
+ cat 1>&2 << EOF
+# WARN: $PREFIX.event.$group.$event.actions cannot be quoted for bootconfig. Skip it.
+EOF
+ continue;;
+ esac;;
+ *) action="\"$action\"";;
+ esac;;
+ *) action="'$action'";;
+ esac
+ emit_kv $PREFIX.event.$group.$event.actions += "$action"
done
if [ $GROUP_ENABLED -eq 0 ] && event_is_enabled $evdir/enable; then
--
2.53.0
next prev parent reply other threads:[~2026-10-31 18:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 18:35 [PATCH 0/5] tools/bootconfig: Fix tracing script filters and histogram dependencies Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` [PATCH 1/5] tools/bootconfig: Read the documented ftrace.notraces key Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` Eduardo Mucelli Rezende Oliveira [this message]
2026-10-31 18:35 ` [PATCH 3/5] tools/bootconfig: Ignore filter strings when resolving histogram variables Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` [PATCH 4/5] tools/bootconfig: Resolve histogram dependencies until no progress is made Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` [PATCH 5/5] tools/bootconfig: Match literal keys in tracing script helpers Eduardo Mucelli Rezende Oliveira
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=001ad0e960ea349b3a5de670944c28853224c0ec.1793471731.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®