aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-10-21 11:08:48 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-10-28 15:14:55 -0400
commit0d0352d8b3d6d7ca9a710b40e194cbbaeb841c88 (patch)
tree1c2e952ee3a56d87836a4223b9d0be060258f8ac
parent18858511fd8a877303cc34c06efa461b26a0e070 (diff)
selftests/ftrace: Fix synthetic event test to delete event correctly
Fix the synthetic event test case to remove event correctly. If redirecting command to synthetic_event file without append mode, it cleans up all existing events and execute (parse) the command. This means "delete event" always fails to find the target event. Since previous synthetic event has a bug which doesn't return -ENOENT even if it fails to find the deleting event, this test passed. But fixing that bug, this test fails because this test itself has a bug. This fixes that bug by trying to delete event right after adding an event, and use append mode redirection ('>>') instead of normal redirection ('>'). Link: http://lkml.kernel.org/r/154013452832.25576.2305459545429386517.stgit@devbox Acked-by: Shuah Khan <shuah@kernel.org> Acked-by: Tom Zanussi <zanussi@linux.intel.com> Tested-by: Tom Zanussi <zanussi@linux.intel.com> Cc: Tom Zanussi <zanussi@kernel.org> Cc: Tom Zanussi <tom.zanussi@linux.intel.com> Cc: Rajvi Jingar <rajvi.jingar@intel.com> Cc: Shuah Khan <shuah@kernel.org> Cc: stable@vger.kernel.org Fixes: f06eec4d0f2c ('selftests: ftrace: Add inter-event hist triggers testcases') Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc
index cef11377dcbd..c604438df13b 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc
@@ -35,18 +35,18 @@ fi
35 35
36reset_trigger 36reset_trigger
37 37
38echo "Test create synthetic event with an error" 38echo "Test remove synthetic event"
39echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null 39echo '!wakeup_latency u64 lat pid_t pid char comm[16]' >> synthetic_events
40if [ -d events/synthetic/wakeup_latency ]; then 40if [ -d events/synthetic/wakeup_latency ]; then
41 fail "Created wakeup_latency synthetic event with an invalid format" 41 fail "Failed to delete wakeup_latency synthetic event"
42fi 42fi
43 43
44reset_trigger 44reset_trigger
45 45
46echo "Test remove synthetic event" 46echo "Test create synthetic event with an error"
47echo '!wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events 47echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null
48if [ -d events/synthetic/wakeup_latency ]; then 48if [ -d events/synthetic/wakeup_latency ]; then
49 fail "Failed to delete wakeup_latency synthetic event" 49 fail "Created wakeup_latency synthetic event with an invalid format"
50fi 50fi
51 51
52do_reset 52do_reset