From: Darrick J. Wong Date: Tue, 8 Apr 2025 18:17:32 +0000 (-0700) Subject: xfs/801: provide missing sysfs-dump function X-Git-Tag: v2025.04.13~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=68e9620be4a677e0af98ef93e4651734d43cc675;p=xfstests-dev.git xfs/801: provide missing sysfs-dump function 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: fstests@vger.kernel.org # v2024.08.11 Fixes: 518896a7b483c0 ("xfs: test online repair when xfiles consists of THPs") Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/801 b/tests/xfs/801 index 1190cfab..a05a6efc 100755 --- a/tests/xfs/801 +++ b/tests/xfs/801 @@ -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