selftests/ftrace: Fix multiple kprobe testcase
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 26 Nov 2019 08:34:42 +0000 (17:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:17:10 +0000 (12:17 +0100)
commitdb3cb5c11ae7215d49f0a32dea65dbcb44239101
treee4515e58a57f235e586646a57a952fc97f730dee
parent6e168ef21fa31396e3a37f0a8a55243630926dbb
selftests/ftrace: Fix multiple kprobe testcase

[ Upstream commit 5cc6c8d4a99d0ee4d5466498e258e593df1d3eb6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc