Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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 <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aR1yRQxDmlfLZzoo@stanley.mountain/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+2 -2
+1 -1
kernel/trace/trace.h
··· 1113 1113 #endif /* CONFIG_DYNAMIC_FTRACE */ 1114 1114 1115 1115 extern unsigned int fgraph_max_depth; 1116 - extern unsigned int fgraph_no_sleep_time; 1116 + extern int fgraph_no_sleep_time; 1117 1117 extern bool fprofile_no_sleep_time; 1118 1118 1119 1119 static inline bool
+1 -1
kernel/trace/trace_functions_graph.c
··· 20 20 static int ftrace_graph_skip_irqs; 21 21 22 22 /* Do not record function time when task is sleeping */ 23 - unsigned int fgraph_no_sleep_time; 23 + int fgraph_no_sleep_time; 24 24 25 25 struct fgraph_cpu_data { 26 26 pid_t last_pid;