From: Steven Rostedt Date: Tue, 25 Nov 2025 15:47:51 +0000 (-0500) Subject: fgraph: Make fgraph_no_sleep_time signed X-Git-Tag: v6.19-rc1~119^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac87b220a6e9530d752ab5718acc7776f9924702;p=thirdparty%2Fkernel%2Flinux.git fgraph: Make fgraph_no_sleep_time signed The variable fgraph_no_sleep_time changed from being a boolean to being a counter. A check is made to make sure that it never goes below zero. But the variable being unsigned makes the check always fail even if it does go below zero. Make the variable a signed int so that checking it going below zero still works. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20251125104751.4c9c7f28@gandalf.local.home Fixes: 5abb6ccb58f0 ("tracing: Have function graph tracer option sleep-time be per instance") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/aR1yRQxDmlfLZzoo@stanley.mountain/ Signed-off-by: Steven Rostedt (Google) --- diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 58be6d741d72e..da5d9527ebd69 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1113,7 +1113,7 @@ static inline void ftrace_graph_addr_finish(struct fgraph_ops *gops, struct ftra #endif /* CONFIG_DYNAMIC_FTRACE */ extern unsigned int fgraph_max_depth; -extern unsigned int fgraph_no_sleep_time; +extern int fgraph_no_sleep_time; extern bool fprofile_no_sleep_time; static inline bool diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 44d5dc5031e21..d0513cfcd9369 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -20,7 +20,7 @@ static int ftrace_graph_skip_irqs; /* Do not record function time when task is sleeping */ -unsigned int fgraph_no_sleep_time; +int fgraph_no_sleep_time; struct fgraph_cpu_data { pid_t last_pid;