diff mbox series

[v2,27/32] selftests/ftrace: Add stacktrace ftrace filter command testcase

Message ID 153443771560.23257.1531051659949223265.stgit@devbox (mailing list archive)
State Superseded
Headers show
Series selftests/ftrace: Improve ftracetest with coverage check | expand

Commit Message

Masami Hiramatsu (Google) Aug. 16, 2018, 4:41 p.m. UTC
Add a test case for stacktrace filter command for ftrace.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../ftrace/test.d/ftrace/func-filter-stacktrace.tc |   12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc

Comments

Steven Rostedt Aug. 24, 2018, 11:28 p.m. UTC | #1
On Fri, 17 Aug 2018 01:41:55 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Add a test case for stacktrace filter command for ftrace.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  .../ftrace/test.d/ftrace/func-filter-stacktrace.tc |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
>  create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc
> 
> 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
> index 000000000000..ec0d8216d509
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc
> @@ -0,0 +1,12 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL2.0
> +# description: ftrace - stacktrace filter command

Add:

 # 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

> +

Can remove the extra line.

-- Steve
diff mbox series

Patch

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
index 000000000000..ec0d8216d509
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-stacktrace.tc
@@ -0,0 +1,12 @@ 
+#!/bin/sh
+# SPDX-License-Identifier: GPL2.0
+# description: ftrace - stacktrace filter command
+
+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
+