summaryrefslogtreecommitdiffstats
path: root/core/modules/debug-report-bwlp
diff options
context:
space:
mode:
authorSimon Rettberg2023-06-27 14:05:37 +0200
committerSimon Rettberg2023-06-27 14:05:37 +0200
commit9c0ed3c04fcac7bbc958f25506d7e09ba12ed13d (patch)
tree4c40b16a7d3c8a5174ddd4ce87206a889bf3df53 /core/modules/debug-report-bwlp
parent[qemu] Passthrough: Find free PCI slot on primary PCI bus (diff)
downloadmltk-9c0ed3c04fcac7bbc958f25506d7e09ba12ed13d.tar.gz
mltk-9c0ed3c04fcac7bbc958f25506d7e09ba12ed13d.tar.xz
mltk-9c0ed3c04fcac7bbc958f25506d7e09ba12ed13d.zip
[debug-report-bwlp] Add lsiommu
Diffstat (limited to 'core/modules/debug-report-bwlp')
-rwxr-xr-xcore/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report1
-rwxr-xr-xcore/modules/debug-report-bwlp/data/opt/openslx/bin/lsiommu26
2 files changed, 27 insertions, 0 deletions
diff --git a/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report b/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report
index 76500c29..87b61041 100755
--- a/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report
+++ b/core/modules/debug-report-bwlp/data/opt/openslx/bin/debug_report
@@ -5,6 +5,7 @@ TOOLS=(
"journalctl -a"
systemctl
loginctl
+ lsiommu
"lspci -nn"
lsusb
lsmod
diff --git a/core/modules/debug-report-bwlp/data/opt/openslx/bin/lsiommu b/core/modules/debug-report-bwlp/data/opt/openslx/bin/lsiommu
new file mode 100755
index 00000000..efd8708e
--- /dev/null
+++ b/core/modules/debug-report-bwlp/data/opt/openslx/bin/lsiommu
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# https://gist.github.com/r15ch13/ba2d738985fce8990a4e9f32d07c6ada
+
+shopt -s nullglob
+lastgroup=""
+for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
+ for d in $g/devices/*; do
+ if [ "${g##*/}" != "$lastgroup" ]; then
+ echo -en "Group ${g##*/}:\t"
+ else
+ echo -en "\t\t"
+ fi
+ lastgroup=${g##*/}
+ lspci -nms ${d##*/} | awk -F'"' '{printf "[%s:%s]", $4, $6}'
+ if [[ -e "$d"/reset ]]; then echo -en " [R] "; else echo -en " "; fi
+
+ lspci -mms ${d##*/} | awk -F'"' '{printf "%s %-40s %s\n", $1, $2, $6}'
+ for u in ${d}/usb*/; do
+ bus=$(cat "${u}/busnum")
+ lsusb -s $bus: | \
+ awk '{gsub(/:/,"",$4); printf "%s|%s %s %s %s|", $6, $1, $2, $3, $4; for(i=7;i<=NF;i++){printf "%s ", $i}; printf "\n"}' | \
+ awk -F'|' '{printf "USB:\t\t[%s]\t\t %-40s %s\n", $1, $2, $3}'
+ done
+ done
+done