mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
selftests/ftrace: Fix multiple kprobe testcase
[ Upstream commit 5cc6c8d4a9
]
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>
This commit is contained in:
parent
c9f08701e6
commit
f6a1ef2528
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue