Merge drm/drm-next into drm-misc-next
[platform/kernel/linux-rpi.git] / tools / testing / selftests / ftrace / test.d / kprobe / uprobe_syntax_errors.tc
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: Uprobe event parser error log check
4 # requires: uprobe_events error_log
5
6 check_error() { # command-with-error-pos-by-^
7     ftrace_errlog_check 'trace_uprobe' "$1" 'uprobe_events'
8 }
9
10 check_error 'p ^/non_exist_file:100'    # FILE_NOT_FOUND
11 check_error 'p ^/sys:100'               # NO_REGULAR_FILE
12 check_error 'p /bin/sh:^10a'            # BAD_UPROBE_OFFS
13 check_error 'p /bin/sh:10(^1a)'         # BAD_REFCNT
14 check_error 'p /bin/sh:10(10^'          # REFCNT_OPEN_BRACE
15 check_error 'p /bin/sh:10(10)^a'        # BAD_REFCNT_SUFFIX
16
17 check_error 'p /bin/sh:10 ^@+ab'        # BAD_FILE_OFFS
18 check_error 'p /bin/sh:10 ^@symbol'     # SYM_ON_UPROBE
19
20 # %return suffix error
21 if grep -q "place (uprobe): .*%return.*" README; then
22 check_error 'p /bin/sh:10^%hoge'        # BAD_ADDR_SUFFIX
23 check_error 'p /bin/sh:10(10)^%return'  # BAD_REFCNT_SUFFIX
24 fi
25
26 exit 0