Skip to contentSkip to conversation

xfs_logprint: print log data to the screen in host-endian order

PATCH In review Darrick J. Wong 2 participants 3 messages Jan 6 – Jan 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_logprint: print log data to the screen in host-endian order

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

Don't make support have to byteswap u32 values when they're digging through broken logs on x86 systems. Also make it more obvious which column is the offset and which are the byte(s).

---
 logprint/log_print_all.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
logprint/log_print_all.c +2 -2
index 0afad597bb6ce0..9c3cd5fb5cfb31 100644
@@ -55,8 +55,8 @@ xlog_recover_print_data(
 
 		while (j < nums) {
 			if ((j % 8) == 0)
-				printf("%2x ", j);
-			printf("%8x ", *dp);
+				printf("%2x: ", j);
+			printf("%08x ", be32_to_cpu(*dp));
 			dp++;
 			j++;
 			if ((j % 8) == 0)
#1 lore raw
Quoted 5 lines · Darrick J. Wong

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

Don't make support have to byteswap u32 values when they're digging through broken logs on x86 systems. Also make it more obvious which column is the offset and which are the byte(s).

I like the new output style. But this might break existing setups (or old users :)). So maybe make this conditional on a command line option instead?

#2 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 5 lines · Darrick J. Wong

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

Don't make support have to byteswap u32 values when they're digging through broken logs on x86 systems. Also make it more obvious which column is the offset and which are the byte(s).

I like the new output style. But this might break existing setups (or old users :)). So maybe make this conditional on a command line option instead?

Ok.

--D