aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/ftrace
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:23:46 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:36 -0600
commit174fd823397a2f19905a20bbcf47907e30e58444 (patch)
tree8b966cbae1bc41a18dfb76067c3cc9dfb84fd4d8 /tools/testing/selftests/ftrace
parentselftests/ftrace: Add function filter on module testcase (diff)
downloadwireguard-linux-174fd823397a2f19905a20bbcf47907e30e58444.tar.xz
wireguard-linux-174fd823397a2f19905a20bbcf47907e30e58444.zip
selftests/ftrace: Add trace_pipe testcase
Add a simple testcase for trace_pipe which can consume ringbuffer. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing/selftests/ftrace')
-rw-r--r--tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc b/tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc
new file mode 100644
index 000000000000..5058fbcfd90f
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc
@@ -0,0 +1,16 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: trace_pipe and trace_marker
+# flags: instance
+
+[ ! -f trace_marker ] && exit_unsupported
+
+echo "test input 1" > trace_marker
+
+: "trace interface never consume the ring buffer"
+grep -q "test input 1" trace
+grep -q "test input 1" trace
+
+: "trace interface never consume the ring buffer"
+head -n 1 trace_pipe | grep -q "test input 1"
+! grep -q "test input 1" trace