diff mbox series

xfs/801: provide missing sysfs-dump function

Message ID 20250408181732.GH6274@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series xfs/801: provide missing sysfs-dump function | expand

Commit Message

Darrick J. Wong April 8, 2025, 6:17 p.m. UTC
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>
---
 tests/xfs/801 |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Zorro Lang April 8, 2025, 7:42 p.m. UTC | #1
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
>  
>
Christoph Hellwig April 10, 2025, 5:36 a.m. UTC | #2
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 mbox series

Patch

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