WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / kprobe / kprobe_args_string.tc
blob84285a6f60b079346a5c527ea99a5d400c678c0a
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: Kprobe event string type argument
4 # requires: kprobe_events
6 case `uname -m` in
7 x86_64)
8 ARG1=%di
9 ;;
10 i[3456]86)
11 ARG1=%ax
13 aarch64)
14 ARG1=%x0
16 arm*)
17 ARG1=%r0
19 ppc64*)
20 ARG1=%r3
22 ppc*)
23 ARG1=%r3
26 echo "Please implement other architecture here"
27 exit_untested
28 esac
30 : "Test get argument (1)"
31 echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events
32 echo 1 > events/kprobes/testprobe/enable
33 echo "p:test $FUNCTION_FORK" >> kprobe_events
34 grep -qe "testprobe.* arg1=\"test\"" trace
36 echo 0 > events/kprobes/testprobe/enable
37 : "Test get argument (2)"
38 echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string arg2=+0(${ARG1}):string" > kprobe_events
39 echo 1 > events/kprobes/testprobe/enable
40 echo "p:test $FUNCTION_FORK" >> kprobe_events
41 grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace