File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
tools/testing/selftests/ftrace/test.d/dynevent Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # SPDX-License-Identifier: GPL-2.0
3+ # description: Checking dynamic events limitations
4+ # requires: dynamic_events "imm-value":README
5+
6+ # Max arguments limitation
7+ MAX_ARGS=128
8+ EXCEED_ARGS=$(( MAX_ARGS + 1 ))
9+
10+ check_max_args () { # event_header
11+ TEST_STRING=$1
12+ # Acceptable
13+ for i in ` seq 1 $MAX_ARGS ` ; do
14+ TEST_STRING=" $TEST_STRING \\ $i "
15+ done
16+ echo " $TEST_STRING " >> dynamic_events
17+ echo > dynamic_events
18+ # Error
19+ TEST_STRING=" $TEST_STRING \\ $EXCEED_ARGS "
20+ ! echo " $TEST_STRING " >> dynamic_events
21+ return 0
22+ }
23+
24+ # Kprobe max args limitation
25+ if grep -q " kprobe_events" README; then
26+ check_max_args " p vfs_read"
27+ fi
28+
29+ # Fprobe max args limitation
30+ if grep -q " f[:[<group>/][<event>]] <func-name>[%return] [<args>]" README; then
31+ check_max_args " f vfs_read"
32+ fi
33+
34+ # Tprobe max args limitation
35+ if grep -q " t[:[<group>/][<event>]] <tracepoint> [<args>]" README; then
36+ check_max_args " t kfree"
37+ fi
38+
39+ # Uprobe max args limitation
40+ if grep -q " uprobe_events" README; then
41+ check_max_args " p /bin/sh:10"
42+ fi
You can’t perform that action at this time.
0 commit comments