]> Git Repo - linux.git/commitdiff
selftests/ftrace: Fix synthetic event test to delete event correctly
authorMasami Hiramatsu <[email protected]>
Sun, 21 Oct 2018 15:08:48 +0000 (00:08 +0900)
committerSteven Rostedt (VMware) <[email protected]>
Sun, 28 Oct 2018 19:14:55 +0000 (15:14 -0400)
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 <[email protected]>
Acked-by: Tom Zanussi <[email protected]>
Tested-by: Tom Zanussi <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: Rajvi Jingar <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: [email protected]
Fixes: f06eec4d0f2c ('selftests: ftrace: Add inter-event hist triggers testcases')
Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc

index cef11377dcbda21b576887a27ad8642ad4bab4a0..c604438df13b3a4a543d04823394f127c61a5092 100644 (file)
@@ -35,18 +35,18 @@ fi
 
 reset_trigger
 
-echo "Test create synthetic event with an error"
-echo 'wakeup_latency  u64 lat pid_t pid char' > synthetic_events > /dev/null
+echo "Test remove synthetic event"
+echo '!wakeup_latency  u64 lat pid_t pid char comm[16]' >> synthetic_events
 if [ -d events/synthetic/wakeup_latency ]; then
-    fail "Created wakeup_latency synthetic event with an invalid format"
+    fail "Failed to delete wakeup_latency synthetic event"
 fi
 
 reset_trigger
 
-echo "Test remove synthetic event"
-echo '!wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
+echo "Test create synthetic event with an error"
+echo 'wakeup_latency  u64 lat pid_t pid char' > synthetic_events > /dev/null
 if [ -d events/synthetic/wakeup_latency ]; then
-    fail "Failed to delete wakeup_latency synthetic event"
+    fail "Created wakeup_latency synthetic event with an invalid format"
 fi
 
 do_reset
This page took 0.051023 seconds and 4 git commands to generate.