aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-08-23 01:26:52 +0900
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-08-23 09:41:55 +0900
commitd892d3d3d885d6b3c5635671e43460dbe8fb32eb (patch)
tree5365d839bea93504f12dd0f63e6e115a473ee5ed /tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
parenttracing/fprobe-event: Assume fprobe is a return event by $retval (diff)
downloadwireguard-linux-d892d3d3d885d6b3c5635671e43460dbe8fb32eb.tar.xz
wireguard-linux-d892d3d3d885d6b3c5635671e43460dbe8fb32eb.zip
selftests/ftrace: Add BTF fields access testcases
Add test cases for accessing the data structure fields using BTF info. This includes the field access from parameters and retval, and accessing string information. Link: https://lore.kernel.org/all/169272161265.160970.14048619786574971276.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Alan Maguire <alan.maguire@oracle.com> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc')
-rw-r--r--tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
index 72563b2e0812..20e42c030095 100644
--- a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
@@ -103,6 +103,14 @@ check_error 'f vfs_read%return ^$arg*' # NOFENTRY_ARGS
check_error 'f vfs_read ^hoge' # NO_BTFARG
check_error 'f kfree ^$arg10' # NO_BTFARG (exceed the number of parameters)
check_error 'f kfree%return ^$retval' # NO_RETVAL
+
+if grep -qF "<argname>[->field[->field|.field...]]" README ; then
+check_error 'f vfs_read%return $retval->^foo' # NO_PTR_STRCT
+check_error 'f vfs_read file->^foo' # NO_BTF_FIELD
+check_error 'f vfs_read file^-.foo' # BAD_HYPHEN
+check_error 'f vfs_read ^file:string' # BAD_TYPE4STR
+fi
+
else
check_error 'f vfs_read ^$arg*' # NOSUP_BTFARG
check_error 't kfree ^$arg*' # NOSUP_BTFARG