Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
47 lines
1.0 KiB
Bash
47 lines
1.0 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Kprobe event string type argument
|
|
|
|
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
|
|
|
echo 0 > events/enable
|
|
echo > kprobe_events
|
|
|
|
case `uname -m` in
|
|
x86_64)
|
|
ARG2=%si
|
|
OFFS=8
|
|
;;
|
|
i[3456]86)
|
|
ARG2=%cx
|
|
OFFS=4
|
|
;;
|
|
aarch64)
|
|
ARG2=%x1
|
|
OFFS=8
|
|
;;
|
|
arm*)
|
|
ARG2=%r1
|
|
OFFS=4
|
|
;;
|
|
*)
|
|
echo "Please implement other architecture here"
|
|
exit_untested
|
|
esac
|
|
|
|
: "Test get argument (1)"
|
|
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string" > kprobe_events
|
|
echo 1 > events/kprobes/testprobe/enable
|
|
! echo test >> kprobe_events
|
|
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\""
|
|
|
|
echo 0 > events/kprobes/testprobe/enable
|
|
: "Test get argument (2)"
|
|
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string arg2=+0(+${OFFS}(${ARG2})):string" > kprobe_events
|
|
echo 1 > events/kprobes/testprobe/enable
|
|
! echo test1 test2 >> kprobe_events
|
|
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\""
|
|
|
|
echo 0 > events/enable
|
|
echo > kprobe_events
|