summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/guest-diag/guest_kprobes.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/guest-diag/guest_kprobes.sh b/tools/guest-diag/guest_kprobes.sh
index 3f28b29..75b2ba3 100644
--- a/tools/guest-diag/guest_kprobes.sh
+++ b/tools/guest-diag/guest_kprobes.sh
@@ -14,6 +14,13 @@
TR=/sys/kernel/tracing
[ -d "$TR" ] || TR=/sys/kernel/debug/tracing
+# A fresh boot may leave tracefs unmounted even though the mount point exists
+# (observed: mkdir of events/kprobes/enable fails with "Directory
+# nonexistent" and every probe add fails silently). Mount it if needed.
+if [ ! -d "$TR/events" ]; then
+ mount -t tracefs tracefs "$TR" 2>/dev/null || \
+ mount -t debugfs debugfs "$TR" 2>/dev/null || true
+fi
# An enabled kprobe event cannot be deleted (EBUSY); disable the group first.
echo 0 > "$TR/events/kprobes/enable" 2>/dev/null || true