summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2026-08-25 19:10:36 -0400
committerSteven Rostedt <rostedt@goodmis.org>2026-10-15 18:21:40 -0400
commit5505be91c9413e52efcb37aea528d5699356e075 (patch)
tree0ada9871a44d19806a0b400f4301f4aa89d960f1 /kernel
parent24a19b953e2a3d0ea5a8c4951a0ab8f32720c907 (diff)
downloadlinux-5505be91c9413e52efcb37aea528d5699356e075.tar.gz
linux-5505be91c9413e52efcb37aea528d5699356e075.zip
ftrace: Have stacktrace option work with func-args
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_functions.c5
1 files changed, 4 insertions, 1 deletions
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++;