selftests/ftrace: Add stacktrace ftrace filter command testcase
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 30 Aug 2018 14:24:14 +0000 (23:24 +0900)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 24 Oct 2018 20:49:36 +0000 (14:49 -0600)
Add a test case for stacktrace filter command for ftrace.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc [new file with mode: 0644]

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc
new file mode 100644 (file)
index 0000000..bf72e78
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL2.0
+# description: ftrace - stacktrace filter command
+# flags: instance
+
+echo _do_fork:stacktrace >> set_ftrace_filter
+
+grep -q "_do_fork:stacktrace:unlimited" set_ftrace_filter
+
+(echo "forked"; sleep 1)
+
+grep -q "<stack trace>" trace