From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 1/9] ftrace: Have stacktrace option work with func-args
Date: Mon, 19 Oct 2026 15:23:45 -0400 [thread overview]
Message-ID: <20261019192359.110757402@kernel.org> (raw)
In-Reply-To: <20261019192344.004592683@kernel.org>
From: Steven Rostedt <rostedt@goodmis.org>
When both the func_stack_trace option is enabled first, the func-args
option can not be enabled. Same if the func-args option is enabled first,
the func_stack_trace option can not be enabled.
Allow the two to work together. The stack trace is already slow and
testing the current tracer flags should be in the noise of overhead.
Link: https://patch.msgid.link/20260825191036.11b19036@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_functions.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index c879d43a5fbb..acaba990aaaa 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -121,6 +121,7 @@ static ftrace_func_t select_trace_function(u32 flags_val)
case TRACE_FUNC_OPT_ARGS:
return function_args_trace_call;
case TRACE_FUNC_OPT_STACK:
+ case TRACE_FUNC_OPT_STACK | TRACE_FUNC_OPT_ARGS:
return function_stack_trace_call;
case TRACE_FUNC_OPT_NO_REPEATS:
return function_no_repeats_trace_call;
@@ -295,7 +296,9 @@ function_stack_trace_call(unsigned long ip, unsigned long parent_ip,
if (likely(disabled == 1)) {
trace_ctx = tracing_gen_ctx_flags(flags);
- trace_function(tr, ip, parent_ip, trace_ctx, NULL);
+ if (!(tr->current_trace_flags->val & TRACE_FUNC_OPT_ARGS))
+ fregs = NULL;
+ trace_function(tr, ip, parent_ip, trace_ctx, fregs);
#ifdef CONFIG_UNWINDER_FRAME_POINTER
if (ftrace_pids_enabled(op))
skip++;
--
2.53.0
next prev parent reply other threads:[~2026-10-19 19:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 19:23 [for-next][PATCH 0/9] tracing: Updates for 7.4 Steven Rostedt
2026-10-19 19:23 ` Steven Rostedt [this message]
2026-10-19 19:23 ` [for-next][PATCH 2/9] tracing: Avoid BTF lookup in atomic context Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 3/9] ftrace: Build trace_btf.c when CONFIG_DEBUG_INFO_BTF is enabled Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 4/9] fgraph: Enhance funcgraph-retval with BTF-based type-aware output Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 5/9] tracing: Update funcgraph-retval documentation Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 6/9] ftrace: Add max field to function profiler stats Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 7/9] ftrace: Do not leak a modules empty page group Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 8/9] ftrace: Let ftrace_call_adjust() reject a patch site Steven Rostedt
2026-10-19 19:23 ` [for-next][PATCH 9/9] ftrace: Initialize modname and offset in print_rec() Steven Rostedt
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=20261019192359.110757402@kernel.org \
--to=rostedt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@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
all inboxes | Powered by JetHome®