summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/guest_kprobes.sh
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 13:52:49 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 13:52:49 -0400
commit6e0efb5bb1282c673f0b4ea0eba0022cbb16ab31 (patch)
treebbff5f338d3f595e74e238b95d9efaab27e3d9b8 /tools/guest-diag/guest_kprobes.sh
parented7cbc582a5602db46932917df002c0d31fdb8fb (diff)
downloadopen-iov-6e0efb5bb1282c673f0b4ea0eba0022cbb16ab31.tar.gz
open-iov-6e0efb5bb1282c673f0b4ea0eba0022cbb16ab31.zip
kernel: authoritative host-injected VA->PA pins (ipin table) + wider pin table
The CE push-buffer page 0x120000000 resolved to a zero-filled page even after sema_map_add injected the correct translation: the shared pin table silently dropped inserts once a hash cluster exceeded the 32-probe window (the page hashes to slot 0, a hot cluster), and lookups fell through to the content-scanned map and answered with a stale page - so every CE push read as implausible and memset stayed 0. Injected translations now live in a separate authoritative table checked before every other source and are never written by self-discovery; the general pin table is 4x larger with a 4x probe window and counts drops (pin_drop/ipin_drop) in the stats line. guest_kprobes.sh disables the kprobe group before removal (EBUSY) and matches p:kprobes/<name>; the guest wait sampler can run counters-only with GDB=0.
Diffstat (limited to 'tools/guest-diag/guest_kprobes.sh')
-rw-r--r--tools/guest-diag/guest_kprobes.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/guest-diag/guest_kprobes.sh b/tools/guest-diag/guest_kprobes.sh
index f676e20..0afe6c6 100644
--- a/tools/guest-diag/guest_kprobes.sh
+++ b/tools/guest-diag/guest_kprobes.sh
@@ -15,29 +15,35 @@
TR=/sys/kernel/tracing
[ -d "$TR" ] || TR=/sys/kernel/debug/tracing
+# An enabled kprobe event cannot be deleted (EBUSY); disable the group first.
+echo 0 > "$TR/events/kprobes/enable" 2>/dev/null || true
+
add_probe() {
name=$1; sym=$2; fmt=$3
+ echo "-:kprobes/$name" >> "$TR/kprobe_events" 2>/dev/null
echo "-:$name" >> "$TR/kprobe_events" 2>/dev/null
if ! grep -qw "$sym" /proc/kallsyms 2>/dev/null; then
echo "FAIL $name: symbol $sym not in kallsyms"
return 1
fi
if echo "p:$name $sym $fmt" >> "$TR/kprobe_events" 2>/dev/null; then
- if grep -q "p:$name" "$TR/kprobe_events" 2>/dev/null; then
+ if grep -qE "p:[^ ]*[ /]$name( |$)" "$TR/kprobe_events" 2>/dev/null; then
echo "ok $name $sym"
return 0
fi
fi
+ echo "-:kprobes/$name" >> "$TR/kprobe_events" 2>/dev/null
echo "-:$name" >> "$TR/kprobe_events" 2>/dev/null
if echo "p:$name nvidia_uvm:$sym $fmt" >> "$TR/kprobe_events" 2>/dev/null; then
- if grep -q "p:$name" "$TR/kprobe_events" 2>/dev/null; then
+ if grep -qE "p:[^ ]*[ /]$name( |$)" "$TR/kprobe_events" 2>/dev/null; then
echo "ok-module $name $sym"
return 0
fi
fi
+ echo "-:kprobes/$name" >> "$TR/kprobe_events" 2>/dev/null
echo "-:$name" >> "$TR/kprobe_events" 2>/dev/null
if echo "p:$name $sym" >> "$TR/kprobe_events" 2>/dev/null; then
- if grep -q "p:$name" "$TR/kprobe_events" 2>/dev/null; then
+ if grep -qE "p:[^ ]*[ /]$name( |$)" "$TR/kprobe_events" 2>/dev/null; then
echo "ok-bare $name $sym"
return 0
fi