]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
selftests/ftrace: Fix to test kprobe $comm arg only if available
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 30 Aug 2018 14:16:13 +0000 (23:16 +0900)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 24 Oct 2018 20:49:35 +0000 (14:49 -0600)
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>
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc

index d783a8ce0692b3525679cc0cec3eab84d43baa13..6f0f199531930e76912b3f0e6da83281ff2d424d 100644 (file)
@@ -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)" \