diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2018-08-30 10:21:25 -0400 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-10-24 16:49:36 -0400 |
commit | 4d23e9b4fd2e44f10d22b9d2ba1dfb3fff8cd9d5 (patch) | |
tree | 57c56fc520fa409530bb68cd55afb4d0555f91ee /tools | |
parent | 873b4af2103fbd1bb7895be202a58878254d89bc (diff) |
selftests/ftrace: Add trace_printk sample module test
Add trace_printk sample module test. This requires to
enable trace_printk.ko module for test.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/event/trace_printk.tc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc b/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc new file mode 100644 index 000000000000..b02550b42be9 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/event/trace_printk.tc | |||
@@ -0,0 +1,27 @@ | |||
1 | #!/bin/sh | ||
2 | # SPDX-License-Identifier: GPL-2.0 | ||
3 | # description: Test trace_printk from module | ||
4 | |||
5 | rmmod trace-printk ||: | ||
6 | if ! modprobe trace-printk ; then | ||
7 | echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=m" | ||
8 | exit_unresolved; | ||
9 | fi | ||
10 | |||
11 | echo "Waiting for irq work" | ||
12 | sleep 1 | ||
13 | |||
14 | grep -q ": This .* trace_bputs" trace | ||
15 | grep -q ": This .* trace_puts" trace | ||
16 | grep -q ": This .* trace_bprintk" trace | ||
17 | grep -q ": This .* trace_printk" trace | ||
18 | |||
19 | grep -q ": (irq) .* trace_bputs" trace | ||
20 | grep -q ": (irq) .* trace_puts" trace | ||
21 | grep -q ": (irq) .* trace_bprintk" trace | ||
22 | grep -q ": (irq) .* trace_printk" trace | ||
23 | |||
24 | grep -q "This is a %s that will use trace_bprintk" printk_formats | ||
25 | grep -q "(irq) This is a static string that will use trace_bputs" printk_formats | ||
26 | |||
27 | rmmod trace-printk ||: | ||