Skip to content

Commit

Permalink
selftests/ftrace: Fix to test kprobe $comm arg only if available
Browse files Browse the repository at this point in the history
Test $comm in kprobe-event argument syntax testcase
only if it is supported on the kernel because
$comm has been introduced 4.8 kernel.
So on older stable kernel, it should be skipped.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
  • Loading branch information
Masami Hiramatsu authored and Shuah Khan (Samsung OSG) committed Oct 24, 2018
1 parent e527c47 commit 2452c96
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ test_badarg "\$stackp" "\$stack0+10" "\$stack1-10"
echo "r ${PROBEFUNC} \$retval" > kprobe_events
! echo "p ${PROBEFUNC} \$retval" > kprobe_events

# $comm was introduced in 4.8, older kernels reject it.
if grep -A1 "fetcharg:" README | grep -q '\$comm' ; then
: "Comm access"
test_goodarg "\$comm"
fi

: "Indirect memory access"
test_goodarg "+0(${GOODREG})" "-0(${GOODREG})" "+10(\$stack)" \
Expand Down

0 comments on commit 2452c96

Please sign in to comment.