From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382011; b=AHrTO+VbYKupJGDSzBlgh6CLY7hdPcxfkB1KY0k21LfjApPbIoMNpplXnW52fGF2Cb4p 8oJ/dQG5/o+Bap5cWVr802aifoez3Qo/GlIgnfp0N68D2O7mhmEh6d/iOdFGCuTRJGPI4 i4EzBHpI/I8muM7Zc9j5YrqHYPOnzS1n/8iRn34h3oWnizU5FsFIhrUIrLWU5jzeo0H6Z NjfHay3bDD6D/2IF2S2WZQDYjYclhgbhxXkfEKcw+W9Epj27MmjJwXKE2ovCgnBDvKX6f 6mAFpsVbbQIw5LOgzQXUKbkBY3AHJlwmclFVOsdS2mAt0jGvPW4Jjk8PRaK6Qz3IlMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382011; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=MIyPCfJpQimBP7EVPBkUlfwe7voT2z15tAM2Yk7Bpng=; b=P1KCHxW6gbH93/u/rBwmjSNPLz32fzyt+vaEGC5Xzu/uXeSDz9sXJsA6iYW3Wfoz24nD jubIYUbw+aHzfRgLms3m+NrUk2e6HIRc2Vo4gF4Mq/m5ePaeOGLwtK6HFJ05T0zWlPiz6 pGALknVwMFLpXqC3CkjE9zmWCHRZcc3VcMSbkMn1lPzy0qjisrIX+sd1iJW1ofiE+UHlD kATwuYzk1Lc/RCbxHkh3AM4JDQ+E+aKeRWygXdBFdjisho2r0JQdSbuzynfexMI8aTXPB oNaTQFGmP33jl/Cp5KLlnzYEi6moRQ2kJVtmEtR0oFwyCCbSiYsDzCMDymi2nC0xbCw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hBQOwLjj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E609C606A336; Fri, 4 Dec 2026 11:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hBQOwLjj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E9DD1F00897; Fri, 4 Dec 2026 11:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382010; bh=MIyPCfJpQimBP7EVPBkUlfwe7voT2z15tAM2Yk7Bpng=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hBQOwLjj1IQi8k3f+LT1nxaJOz9wO2FU2aPFuAE6n6XUzzgTyizji/QlIATHNb0bd VBkE3iJIIQFpqNGbzes+rtMqNKNPKYEjydCiWebDdOW43LG8HxlT4pjupNZJsnGcwG SDbpfFdgG/ypXsgfeHHKEUdp7sYBU+HxSrF13rw0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eduardo Mucelli Rezende Oliveira , "Masami Hiramatsu (Google)" , Sasha Levin Subject: [PATCH 6.18 232/703] tools/bootconfig: Use the registered global tracing parameter names Date: Fri, 4 Dec 2026 19:02:11 +0900 Message-ID: <20261204100633.992331570@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eduardo Mucelli Rezende Oliveira [ Upstream commit 51934668ca98f1b23c51ce4edea3c61018da342c ] The boot-time tracing guide lists four kernel.* keys that do not match the parameters registered by the tracing code. For example, ftrace2bconf.sh emits kernel.fgraph_max_depth, which bootconfig passes as fgraph_max_depth on the kernel command line. The function-graph tracer registers ftrace_graph_max_depth. Use the registered names in the guide and the exporter. Teach bconf2ftrace.sh to read those names, with the previous script keys as fallbacks so existing replay configurations still work. Link: https://lore.kernel.org/all/fecf6e33d4f7e2ddf031526e7a1abef27e28f754.1795307698.git.edumucelli@gmail.com/ Fixes: 47781947947a ("Documentation: tracing: Add boot-time tracing document") Fixes: 7e66ef0046cc ("tools/bootconfig: Add a script to generate ftrace shell-command from bootconfig") Fixes: 2b86062a34a8 ("tools/bootconfig: Add a script to generates bootconfig from ftrace") Signed-off-by: Eduardo Mucelli Rezende Oliveira Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin --- Documentation/trace/boottime-trace.rst | 8 ++++---- tools/bootconfig/scripts/bconf2ftrace.sh | 21 ++++++++++++++++----- tools/bootconfig/scripts/ftrace2bconf.sh | 5 +++-- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Documentation/trace/boottime-trace.rst b/Documentation/trace/boottime-trace.rst index 651f3a2c01de8..1bacbd13fb5f0 100644 --- a/Documentation/trace/boottime-trace.rst +++ b/Documentation/trace/boottime-trace.rst @@ -36,20 +36,20 @@ these options are passed as a part of kernel legacy command line. kernel.tp_printk Output trace-event data on printk buffer too. -kernel.dump_on_oops [= MODE] +kernel.ftrace_dump_on_oops [= MODE] Dump ftrace on Oops. If MODE = 1 or omitted, dump trace buffer on all CPUs. If MODE = 2, dump a buffer on a CPU which kicks Oops. kernel.traceoff_on_warning Stop tracing if WARN_ON() occurs. -kernel.fgraph_max_depth = MAX_DEPTH +kernel.ftrace_graph_max_depth = MAX_DEPTH Set MAX_DEPTH to maximum depth of fgraph tracer. -kernel.fgraph_filters = FILTER[, FILTER2...] +kernel.ftrace_graph_filter = FILTER[, FILTER2...] Add fgraph tracing function filters. -kernel.fgraph_notraces = FILTER[, FILTER2...] +kernel.ftrace_graph_notrace = FILTER[, FILTER2...] Add fgraph non-tracing function filters. diff --git a/tools/bootconfig/scripts/bconf2ftrace.sh b/tools/bootconfig/scripts/bconf2ftrace.sh index 850c2073433e1..ba29f7411f62a 100755 --- a/tools/bootconfig/scripts/bconf2ftrace.sh +++ b/tools/bootconfig/scripts/bconf2ftrace.sh @@ -275,15 +275,26 @@ setup_instance() { # [instance] } # ftrace global configs (kernel.*) -if xbc_has_key "kernel.dump_on_oops"; then - dump_mode=`xbc_get_val "kernel.dump_on_oops" 1` +# Prefer the kernel parameter names and accept the old script keys as fallbacks. +dump_key=kernel.ftrace_dump_on_oops +xbc_has_key "$dump_key" || dump_key=kernel.dump_on_oops +if xbc_has_key "$dump_key"; then + dump_mode=`xbc_get_val "$dump_key" 1` [ "$dump_mode" ] && dump_mode=`eval echo $dump_mode` || dump_mode=1 run_cmd "echo \"$dump_mode\" > /proc/sys/kernel/ftrace_dump_on_oops" fi -set_value_of kernel.fgraph_max_depth $TRACEFS/max_graph_depth -set_array_of kernel.fgraph_filters $TRACEFS/set_graph_function -set_array_of kernel.fgraph_notraces $TRACEFS/set_graph_notrace +graph_depth_key=kernel.ftrace_graph_max_depth +xbc_has_key "$graph_depth_key" || graph_depth_key=kernel.fgraph_max_depth +set_value_of "$graph_depth_key" $TRACEFS/max_graph_depth + +graph_filter_key=kernel.ftrace_graph_filter +xbc_has_key "$graph_filter_key" || graph_filter_key=kernel.fgraph_filters +set_array_of "$graph_filter_key" $TRACEFS/set_graph_function + +graph_notrace_key=kernel.ftrace_graph_notrace +xbc_has_key "$graph_notrace_key" || graph_notrace_key=kernel.fgraph_notraces +set_array_of "$graph_notrace_key" $TRACEFS/set_graph_notrace # Per-instance/per-event configs if ! xbc_has_branch "ftrace" ; then diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh index 1603801cf1264..564a3085525f3 100755 --- a/tools/bootconfig/scripts/ftrace2bconf.sh +++ b/tools/bootconfig/scripts/ftrace2bconf.sh @@ -46,10 +46,11 @@ emit_kv() { # key =|+= value global_options() { val=`cat $TRACEFS/max_graph_depth` - [ $val != 0 ] && emit_kv kernel.fgraph_max_depth = $val + [ $val != 0 ] && emit_kv kernel.ftrace_graph_max_depth = $val if grep -qv "^#" $TRACEFS/set_graph_function $TRACEFS/set_graph_notrace ; then cat 1>&2 << EOF -# WARN: kernel.fgraph_filters and kernel.fgraph_notrace are not supported, since the wild card expression was expanded and lost from memory. +# WARN: Cannot export kernel.ftrace_graph_filter and kernel.ftrace_graph_notrace. +# Only the expanded function list is available. EOF fi } -- 2.53.0