ftrace/selftest: Have the reset_trigger code be a bit more careful
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 14 May 2018 19:40:29 +0000 (15:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:24:48 +0000 (11:24 +0200)
commit5f7a15af646d8c9cf52f7d86b43a590fabf4e808
tree4803d211cff882d9095dc5a62a24fcc2ef559aa6
parentea0ac01f68aa01cc391f18148342fc4ecc912860
ftrace/selftest: Have the reset_trigger code be a bit more careful

commit 756b56a9e832e063edc83be7c3889e98c536dd2b upstream.

The trigger code is picky in how it can be disabled as there may be
dependencies between different events and synthetic events. Change the order
on how triggers are reset.

 1) Reset triggers of all synthetic events first
 2) Remove triggers with actions attached to them
 3) Remove all other triggers

If this order isn't followed, then some triggers will not be reset, and an
error may happen because a trigger is busy.

Cc: stable@vger.kernel.org
Fixes: cfa0963dc474f ("kselftests/ftrace : Add event trigger testcases")
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/functions