aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:16:13 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:35 -0600
commit2452c96e617a0ff6fb2692e55217a3fa57a7322c (patch)
tree236470176a5f0546f4584524dba27cd3ebc9e565 /tools/testing/selftests/ftrace
parentselftests/ftrace: Remove unneeded per-test init/cleanup ftrace (diff)
downloadlinux-dev-2452c96e617a0ff6fb2692e55217a3fa57a7322c.tar.xz
linux-dev-2452c96e617a0ff6fb2692e55217a3fa57a7322c.zip
selftests/ftrace: Fix to test kprobe $comm arg only if available
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>
Diffstat (limited to 'tools/testing/selftests/ftrace')
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
index d783a8ce0692..6f0f19953193 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
@@ -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)" \