Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ea1a153 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

tracing/urgent: warn in case of ftrace_start_up inbalance



Prevent from further ftrace_start_up inbalances so that we avoid
future nop patching omissions with dynamic ftrace.

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
parent c85a17e2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1224,6 +1224,13 @@ static void ftrace_shutdown(int command)
		return;

	ftrace_start_up--;
	/*
	 * Just warn in case of unbalance, no need to kill ftrace, it's not
	 * critical but the ftrace_call callers may be never nopped again after
	 * further ftrace uses.
	 */
	WARN_ON_ONCE(ftrace_start_up < 0);

	if (!ftrace_start_up)
		command |= FTRACE_DISABLE_CALLS;