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)
38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Kprobe event auto/manual naming
|
|
|
|
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
|
|
|
disable_events
|
|
echo > kprobe_events
|
|
|
|
:;: "Add an event on function without name" ;:
|
|
|
|
FUNC=`grep " [tT] .*vfs_read$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "`
|
|
[ "x" != "x$FUNC" ] || exit_unresolved
|
|
echo "p $FUNC" > kprobe_events
|
|
PROBE_NAME=`echo $FUNC | tr ".:" "_"`
|
|
test -d events/kprobes/p_${PROBE_NAME}_0 || exit_failure
|
|
|
|
:;: "Add an event on function with new name" ;:
|
|
|
|
echo "p:event1 $FUNC" > kprobe_events
|
|
test -d events/kprobes/event1 || exit_failure
|
|
|
|
:;: "Add an event on function with new name and group" ;:
|
|
|
|
echo "p:kprobes2/event2 $FUNC" > kprobe_events
|
|
test -d events/kprobes2/event2 || exit_failure
|
|
|
|
:;: "Add an event on dot function without name" ;:
|
|
|
|
FUNC=`grep -m 10 " [tT] .*\.isra\..*$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "`
|
|
[ "x" != "x$FUNC" ] || exit_unresolved
|
|
echo "p $FUNC" > kprobe_events
|
|
EVENT=`grep $FUNC kprobe_events | cut -f 1 -d " " | cut -f 2 -d:`
|
|
[ "x" != "x$EVENT" ] || exit_failure
|
|
test -d events/$EVENT || exit_failure
|
|
|
|
echo > kprobe_events
|