Message ID | 20250408181732.GH6274@frogsfrogsfrogs (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | xfs/801: provide missing sysfs-dump function | expand |
On Tue, Apr 08, 2025 at 11:17:32AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@kernel.org> > > 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" <djwong@kernel.org> > --- Reviewed-by: Zorro Lang <zlang@redhat.com> > tests/xfs/801 | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/tests/xfs/801 b/tests/xfs/801 > index 1190cfab8a9f94..a05a6efc1a9058 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 > >
On Tue, Apr 08, 2025 at 11:17:32AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@kernel.org> > > 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: Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/tests/xfs/801 b/tests/xfs/801 index 1190cfab8a9f94..a05a6efc1a9058 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