Skip to content

Commit ac87b22

Browse files
committed
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: 5abb6cc ("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>
1 parent bc089c4 commit ac87b22

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/trace/trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ static inline void ftrace_graph_addr_finish(struct fgraph_ops *gops, struct ftra
11131113
#endif /* CONFIG_DYNAMIC_FTRACE */
11141114

11151115
extern unsigned int fgraph_max_depth;
1116-
extern unsigned int fgraph_no_sleep_time;
1116+
extern int fgraph_no_sleep_time;
11171117
extern bool fprofile_no_sleep_time;
11181118

11191119
static inline bool

kernel/trace/trace_functions_graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
static int ftrace_graph_skip_irqs;
2121

2222
/* Do not record function time when task is sleeping */
23-
unsigned int fgraph_no_sleep_time;
23+
int fgraph_no_sleep_time;
2424

2525
struct fgraph_cpu_data {
2626
pid_t last_pid;

0 commit comments

Comments
 (0)