]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tracing: Fix wakeup tracers on failure of acquiring calltime
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 8 Oct 2025 15:48:35 +0000 (11:48 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 8 Oct 2025 16:10:26 +0000 (12:10 -0400)
commit4f7bf54b07e5acf79edd58dafede4096854776cd
treed9fb7826270ae00107aabfe8ea1acee4c8c9eb94
parentf0c029d2ff42499a62c873c14428f02bf94c28af
tracing: Fix wakeup tracers on failure of acquiring calltime

The functions wakeup_graph_entry() and wakeup_graph_return() both call
func_prolog_preempt_disable() that will test if the data->disable is
already set and if not, increment it and disable preemption. If it was
set, it returns false and the caller exits.

The caller of this function must decrement the disable counter, but misses
doing so if the calltime fails to be acquired.

Instead of exiting out when calltime is NULL, change the logic to do the
work if it is not NULL and still do the clean up at the end of the
function if it is NULL.

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20251008114835.027b878a@gandalf.local.home
Fixes: a485ea9e3ef3 ("tracing: Fix irqsoff and wakeup latency tracers when using function graph")
Reported-by: Sasha Levin <sashal@kernel.org>
Closes: https://lore.kernel.org/linux-trace-kernel/20251006175848.1906912-1-sashal@kernel.org/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_sched_wakeup.c