Skip to contentSkip to conversation

xfs/801: provide missing sysfs-dump function

PATCH In review Darrick J. Wong 3 participants 3 messages Apr 8, 2025 – Apr 10, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs/801: provide missing sysfs-dump function

From: Darrick J. Wong <[email protected]>

This test uses sysfs-dump to capture THP diagnostic information to $seqres.full. Unfortunately, that's not a standard program (it's one of my many tools) and I forgot to paste the script into the test. Hence it's been broken since merge for everyone else. Fix it.

Cc <[email protected]> # v2024.08.11
Fixes 518896a7b483c0 ("xfs: test online repair when xfiles consists of THPs")
---
 tests/xfs/801 |   12 ++++++++++++
 1 file changed, 12 insertions(+)
tests/xfs/801 +12 -0
index 1190cfab8a9f94..a05a6efc1a9058 100755
@@ -42,6 +42,18 @@ test -w "$knob" || _notrun "tmpfs transparent hugepages disabled"
 pagesize=`getconf PAGE_SIZE`
 pagesize_kb=$((pagesize / 1024))
 
+sysfs-dump() {
+	for i in "$@"; do
+		if [ -d "$i" ]; then
+			for x in "$i/"*; do
+				test -f "$x" && echo "$x: $(cat "$x")"
+			done
+		else
+			test -f "$i" && echo "$i: $(cat "$i")"
+		fi
+	done
+}
+
 echo "settings now: pagesize=${pagesize_kb}KB" >> $seqres.full
 sysfs-dump /sys/kernel/mm/transparent_hugepage/* >> $seqres.full
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

This test uses sysfs-dump to capture THP diagnostic information to $seqres.full. Unfortunately, that's not a standard program (it's one of my many tools) and I forgot to paste the script into the test. Hence it's been broken since merge for everyone else. Fix it.

Cc <[email protected]> # v2024.08.11
Fixes 518896a7b483c0 ("xfs: test online repair when xfiles consists of THPs")

---

Quoted 27 lines
 tests/xfs/801 |   12 ++++++++++++
 1 file changed, 12 insertions(+)
tests/xfs/801 +12 -0
index 1190cfab8a9f94..a05a6efc1a9058 100755
@@ -42,6 +42,18 @@ test -w "$knob" || _notrun "tmpfs transparent hugepages disabled"
 pagesize=`getconf PAGE_SIZE`
 pagesize_kb=$((pagesize / 1024))
 
+sysfs-dump() {
+	for i in "$@"; do
+		if [ -d "$i" ]; then
+			for x in "$i/"*; do
+				test -f "$x" && echo "$x: $(cat "$x")"
+			done
+		else
+			test -f "$i" && echo "$i: $(cat "$i")"
+		fi
+	done
+}
+
 echo "settings now: pagesize=${pagesize_kb}KB" >> $seqres.full
 sysfs-dump /sys/kernel/mm/transparent_hugepage/* >> $seqres.full
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

This test uses sysfs-dump to capture THP diagnostic information to $seqres.full. Unfortunately, that's not a standard program (it's one of my many tools) and I forgot to paste the script into the test. Hence it's been broken since merge for everyone else. Fix it.

Looks good: