diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-11-26 17:34:42 +0900 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2019-12-17 10:19:47 -0700 |
commit | 2f4f94a7926fa171b2bf829da024dd66b823c638 (patch) | |
tree | a479a9eed917065252fcfe12cf26bfcd77b73243 /tools | |
parent | c52b4687b2ba1f367ccbb4938051a0d1c796c9df (diff) | |
download | linux-next-2f4f94a7926fa171b2bf829da024dd66b823c638.tar.gz |
selftests/ftrace: Fix multiple kprobe testcase
Fix multiple kprobe event testcase to work it correctly.
There are 2 bugfixes.
- Since `wc -l FILE` returns not only line number but also
FILE filename, following "if" statement always failed.
Fix this bug by replacing it with 'cat FILE | wc -l'
- Since "while do-done loop" block with pipeline becomes a
subshell, $N local variable is not update outside of
the loop.
Fix this bug by using actual target number (256) instead
of $N.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc index 5862eee91e1d..6e3dbe5f96b7 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc @@ -20,9 +20,9 @@ while read i; do test $N -eq 256 && break done -L=`wc -l kprobe_events` -if [ $L -ne $N ]; then - echo "The number of kprobes events ($L) is not $N" +L=`cat kprobe_events | wc -l` +if [ $L -ne 256 ]; then + echo "The number of kprobes events ($L) is not 256" exit_fail fi |