diff options
author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2022-08-01 11:32:34 +0900 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-09-26 13:01:08 -0400 |
commit | 9e14bae7d049cfdd5ab22cb200bc7ea847cfa8c9 (patch) | |
tree | f6a7f9cd6b02eb8151825e7e211f52042edc9095 /tools | |
parent | 752be5c5c910a1a270e97b5b39c7a7d06a39e7c6 (diff) | |
download | linux-stable-9e14bae7d049cfdd5ab22cb200bc7ea847cfa8c9.tar.gz linux-stable-9e14bae7d049cfdd5ab22cb200bc7ea847cfa8c9.tar.bz2 linux-stable-9e14bae7d049cfdd5ab22cb200bc7ea847cfa8c9.zip |
selftests/ftrace: Add eprobe syntax error testcase
Add a syntax error test case for eprobe as same as kprobes.
Link: https://lkml.kernel.org/r/165932115471.2850673.8014722990775242727.stgit@devnote2
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc new file mode 100644 index 000000000000..fc1daac7f066 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc @@ -0,0 +1,27 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Event probe event parser error log check +# requires: dynamic_events events/syscalls/sys_enter_openat "<attached-group>.<attached-event> [<args>]":README error_log + +check_error() { # command-with-error-pos-by-^ + ftrace_errlog_check 'event_probe' "$1" 'dynamic_events' +} + +check_error 'e ^a.' # NO_EVENT_INFO +check_error 'e ^.b' # NO_EVENT_INFO +check_error 'e ^a.b' # BAD_ATTACH_EVENT +check_error 'e syscalls/sys_enter_openat ^foo' # BAD_ATTACH_ARG +check_error 'e:^/bar syscalls/sys_enter_openat' # NO_GROUP_NAME +check_error 'e:^12345678901234567890123456789012345678901234567890123456789012345/bar syscalls/sys_enter_openat' # GROUP_TOO_LONG + +check_error 'e:^foo.1/bar syscalls/sys_enter_openat' # BAD_GROUP_NAME +check_error 'e:^ syscalls/sys_enter_openat' # NO_EVENT_NAME +check_error 'e:foo/^12345678901234567890123456789012345678901234567890123456789012345 syscalls/sys_enter_openat' # EVENT_TOO_LONG +check_error 'e:foo/^bar.1 syscalls/sys_enter_openat' # BAD_EVENT_NAME + +check_error 'e:foo/bar syscalls/sys_enter_openat arg=^dfd' # BAD_FETCH_ARG +check_error 'e:foo/bar syscalls/sys_enter_openat ^arg=$foo' # BAD_ATTACH_ARG + +check_error 'e:foo/bar syscalls/sys_enter_openat if ^' # NO_EP_FILTER + +exit 0 |