summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:19:59 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:35 -0600
commitb0898e84851c96248c376897c96f3fde3ff7e3b5 (patch)
treef717d6e3db86acc4ba6ddd36a7473be42cb6b554 /tools
parentddbc31e63aef5e7d12f28f3ac4742420bd5b274c (diff)
downloadlinux-b0898e84851c96248c376897c96f3fde3ff7e3b5.tar.gz
linux-b0898e84851c96248c376897c96f3fde3ff7e3b5.tar.bz2
linux-b0898e84851c96248c376897c96f3fde3ff7e3b5.zip
selftests/ftrace: Add kprobe event with $comm argument testcase
Add kprobe-event with $comm argument testcase to ftracetest. This not only checks syntax but also checks log file. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc
new file mode 100644
index 000000000000..15c1f70fcaf9
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_comm.tc
@@ -0,0 +1,17 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: Kprobe event with comm arguments
+
+[ -f kprobe_events ] || exit_unsupported # this is configurable
+
+grep -A1 "fetcharg:" README | grep -q "\$comm" || exit_unsupported # this is too old
+
+echo 'p:testprobe _do_fork comm=$comm ' > kprobe_events
+grep testprobe kprobe_events | grep -q 'comm=$comm'
+test -d events/kprobes/testprobe
+
+echo 1 > events/kprobes/testprobe/enable
+( echo "forked")
+grep testprobe trace | grep -q 'comm=".*"'
+
+exit 0