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: Export tracing state without the function graph tracer
Date: Sat, 28 Nov 2026 12:57:57 +0100 [thread overview]
Message-ID: <e8de5737f07a1cfee7f8530b82cfeed3e963ce21.1795867077.git.edumucelli@gmail.com> (raw)
In-Reply-To: <cover.1795867077.git.edumucelli@gmail.com>
The function graph tracer provides max_graph_depth. With that tracer
omitted, the unconditional read fails under set -e, and ftrace2bconf
exits before exporting any ordinary tracing state.
Read the depth only when tracefs provides it. Check each available
function graph filter file and keep the existing warning when an
expanded filter list is present.
Fixes: 2b86062a34a8 ("tools/bootconfig: Add a script to generates bootconfig from ftrace")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
---
tools/bootconfig/scripts/ftrace2bconf.sh | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh
index b685dd6b070b0c..de571ec11b4392 100755
--- a/tools/bootconfig/scripts/ftrace2bconf.sh
+++ b/tools/bootconfig/scripts/ftrace2bconf.sh
@@ -45,14 +45,20 @@ emit_kv() { # key =|+= value
}
global_options() {
- val=`cat $TRACEFS/max_graph_depth`
- [ $val != 0 ] && emit_kv kernel.ftrace_graph_max_depth = $val
- if grep -qv "^#" $TRACEFS/set_graph_function $TRACEFS/set_graph_notrace ; then
+ if [ -f "$TRACEFS/max_graph_depth" ]; then
+ val=$(cat "$TRACEFS/max_graph_depth")
+ [ "$val" != 0 ] && emit_kv kernel.ftrace_graph_max_depth = "$val"
+ fi
+ for filter in "$TRACEFS/set_graph_function" "$TRACEFS/set_graph_notrace"; do
+ if [ ! -f "$filter" ] || ! grep -qv "^#" "$filter"; then
+ continue
+ fi
cat 1>&2 << EOF
# WARN: Cannot export kernel.ftrace_graph_filter and kernel.ftrace_graph_notrace.
# Only the expanded function list is available.
EOF
- fi
+ break
+ done
}
kprobe_event_options() {
--
2.53.0
prev parent reply other threads:[~2026-11-28 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 11:57 [PATCH 0/2] tools/bootconfig: Fix tracing settings export Eduardo Mucelli Rezende Oliveira
2026-11-28 11:57 ` [PATCH 1/2] tools/bootconfig: Preserve event enable state when retrying histograms Eduardo Mucelli Rezende Oliveira
2026-11-28 11:57 ` 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=e8de5737f07a1cfee7f8530b82cfeed3e963ce21.1795867077.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®