Commit ac87b220 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt (Google)
Browse files

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: 5abb6ccb ("tracing: Have function graph tracer option sleep-time be per instance")
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aR1yRQxDmlfLZzoo@stanley.mountain/


Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent bc089c47
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;