diff mbox

[13/39] xfs_db: print one array element per line

Message ID 147743669846.11035.8419161903309169766.stgit@birch.djwong.org (mailing list archive)
State Accepted
Headers show

Commit Message

Darrick J. Wong Oct. 25, 2016, 11:04 p.m. UTC
Print one array element per line so that the debugger output isn't
a gigantic pile of screen snow.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/print.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dave Chinner Oct. 26, 2016, 12:51 a.m. UTC | #1
On Tue, Oct 25, 2016 at 04:04:58PM -0700, Darrick J. Wong wrote:
> Print one array element per line so that the debugger output isn't
> a gigantic pile of screen snow.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

What commands does this affect?

Cheers,

Dave.
Darrick J. Wong Oct. 26, 2016, 1:13 a.m. UTC | #2
On Wed, Oct 26, 2016 at 11:51:38AM +1100, Dave Chinner wrote:
> On Tue, Oct 25, 2016 at 04:04:58PM -0700, Darrick J. Wong wrote:
> > Print one array element per line so that the debugger output isn't
> > a gigantic pile of screen snow.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> What commands does this affect?

The 'print' command.

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dave Chinner Oct. 26, 2016, 3:23 a.m. UTC | #3
On Tue, Oct 25, 2016 at 06:13:43PM -0700, Darrick J. Wong wrote:
> On Wed, Oct 26, 2016 at 11:51:38AM +1100, Dave Chinner wrote:
> > On Tue, Oct 25, 2016 at 04:04:58PM -0700, Darrick J. Wong wrote:
> > > Print one array element per line so that the debugger output isn't
> > > a gigantic pile of screen snow.
> > > 
> > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > What commands does this affect?
> 
> The 'print' command.

Ok, let me be more specific - what is an example of the change of
behaviour? printing bmbt records in a block, or something else?
Can you post a before/after example?

Cheers,

Dave.
Darrick J. Wong Oct. 26, 2016, 3:34 a.m. UTC | #4
On Wed, Oct 26, 2016 at 02:23:08PM +1100, Dave Chinner wrote:
> On Tue, Oct 25, 2016 at 06:13:43PM -0700, Darrick J. Wong wrote:
> > On Wed, Oct 26, 2016 at 11:51:38AM +1100, Dave Chinner wrote:
> > > On Tue, Oct 25, 2016 at 04:04:58PM -0700, Darrick J. Wong wrote:
> > > > Print one array element per line so that the debugger output isn't
> > > > a gigantic pile of screen snow.
> > > > 
> > > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > > 
> > > What commands does this affect?
> > 
> > The 'print' command.
> 
> Ok, let me be more specific - what is an example of the change of
> behaviour? printing bmbt records in a block, or something else?
> Can you post a before/after example?

Oh, sorry.  The patch changes the print command such that arrays of
records are printed with one record per line instead of one enormously
long line.

Before (inobt):

xfs_db> p recs
recs[1-55] = [startino,holemask,count,freecount,free] 
1:[128,0,64,0,0] 2:[4288,0xff,32,0,0xffffffff] 3:[4352,0,64,0,0] 4:[4416,0,64,10,0x1f0003e000000000] 5:[4480,0,64,17,0xc00e1803c2007840] 6:[4544,0,64,18,0x21e00c3801870070] 7:[4608,0,64,16,0x403e0007c010f00] 8:[4672,0,64,28,0xe1f07c3e8078200f] 9:[4736,0,64,18,0x838030700e0c01c1] 10:[4800,0,64,33,0xe1f07c3e0f87c10f] 11:[4864,0,64,33,0xc3e0f87c1f0f83e1] 12:[4928,0,64,33,0xf87c1f0f83e1f07] 13:[4992,0,64,32,0x7c3e0f87c1f0f83] 14:[5056,0,64,38,0xf87c1f0ff0f83e1f] 15:[5120,0,64,32,0x83e1f07c3e0f87c1] 16:[5184,0,64,32,0xc1f0f83e1f07c3e0] 17:[5248,0,64,35,0x7c1f0f837c3e0f87] 18:[5312,0,64,33,0xe0f87c1f0f83e1f0] 19:[5376,0,64,33,0x87c1f0f83e1f07c3] 20:[5440,0,64,34,0x1f0f83e1f07c3e0f] 

After:

xfs_db> p recs
recs[1-55] = [startino,holemask,count,freecount,free] 
1:[128,0,64,0,0] 
2:[4288,0xff,32,0,0xffffffff] 
3:[4352,0,64,0,0] 
4:[4416,0,64,10,0x1f0003e000000000] 
5:[4480,0,64,17,0xc00e1803c2007840] 
6:[4544,0,64,18,0x21e00c3801870070] 
7:[4608,0,64,16,0x403e0007c010f00] 
8:[4672,0,64,28,0xe1f07c3e8078200f] 
9:[4736,0,64,18,0x838030700e0c01c1] 
10:[4800,0,64,33,0xe1f07c3e0f87c10f] 
11:[4864,0,64,33,0xc3e0f87c1f0f83e1] 
12:[4928,0,64,33,0xf87c1f0f83e1f07] 
13:[4992,0,64,32,0x7c3e0f87c1f0f83] 
14:[5056,0,64,38,0xf87c1f0ff0f83e1f] 
15:[5120,0,64,32,0x83e1f07c3e0f87c1] 
16:[5184,0,64,32,0xc1f0f83e1f07c3e0] 
17:[5248,0,64,35,0x7c1f0f837c3e0f87] 
18:[5312,0,64,33,0xe0f87c1f0f83e1f0] 
19:[5376,0,64,33,0x87c1f0f83e1f07c3] 
20:[5440,0,64,34,0x1f0f83e1f07c3e0f] 

Somewhat less eyeball-bleeding, hopefully. :)

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dave Chinner Oct. 26, 2016, 5:48 a.m. UTC | #5
On Tue, Oct 25, 2016 at 08:34:13PM -0700, Darrick J. Wong wrote:
> On Wed, Oct 26, 2016 at 02:23:08PM +1100, Dave Chinner wrote:
> > On Tue, Oct 25, 2016 at 06:13:43PM -0700, Darrick J. Wong wrote:
> > > On Wed, Oct 26, 2016 at 11:51:38AM +1100, Dave Chinner wrote:
> > > > On Tue, Oct 25, 2016 at 04:04:58PM -0700, Darrick J. Wong wrote:
> > > > > Print one array element per line so that the debugger output isn't
> > > > > a gigantic pile of screen snow.
> > > > > 
> > > > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > > > 
> > > > What commands does this affect?
> > > 
> > > The 'print' command.
> > 
> > Ok, let me be more specific - what is an example of the change of
> > behaviour? printing bmbt records in a block, or something else?
> > Can you post a before/after example?
> 
> Oh, sorry.  The patch changes the print command such that arrays of
> records are printed with one record per line instead of one enormously
> long line.
> 
> Before (inobt):
> 
> xfs_db> p recs
> recs[1-55] = [startino,holemask,count,freecount,free] 
> 1:[128,0,64,0,0] 2:[4288,0xff,32,0,0xffffffff] 3:[4352,0,64,0,0] 4:[4416,0,64,10,0x1f0003e000000000] 5:[4480,0,64,17,0xc00e1803c2007840] 6:[4544,0,64,18,0x21e00c3801870070] 7:[4608,0,64,16,0x403e0007c010f00] 8:[4672,0,64,28,0xe1f07c3e8078200f] 9:[4736,0,64,18,0x838030700e0c01c1] 10:[4800,0,64,33,0xe1f07c3e0f87c10f] 11:[4864,0,64,33,0xc3e0f87c1f0f83e1] 12:[4928,0,64,33,0xf87c1f0f83e1f07] 13:[4992,0,64,32,0x7c3e0f87c1f0f83] 14:[5056,0,64,38,0xf87c1f0ff0f83e1f] 15:[5120,0,64,32,0x83e1f07c3e0f87c1] 16:[5184,0,64,32,0xc1f0f83e1f07c3e0] 17:[5248,0,64,35,0x7c1f0f837c3e0f87] 18:[5312,0,64,33,0xe0f87c1f0f83e1f0] 19:[5376,0,64,33,0x87c1f0f83e1f07c3] 20:[5440,0,64,34,0x1f0f83e1f07c3e0f] 
> 
> After:
> 
> xfs_db> p recs
> recs[1-55] = [startino,holemask,count,freecount,free] 
> 1:[128,0,64,0,0] 
> 2:[4288,0xff,32,0,0xffffffff] 
> 3:[4352,0,64,0,0] 
> 4:[4416,0,64,10,0x1f0003e000000000] 
> 5:[4480,0,64,17,0xc00e1803c2007840] 
> 6:[4544,0,64,18,0x21e00c3801870070] 
> 7:[4608,0,64,16,0x403e0007c010f00] 
> 8:[4672,0,64,28,0xe1f07c3e8078200f] 
> 9:[4736,0,64,18,0x838030700e0c01c1] 
> 10:[4800,0,64,33,0xe1f07c3e0f87c10f] 
> 11:[4864,0,64,33,0xc3e0f87c1f0f83e1] 
> 12:[4928,0,64,33,0xf87c1f0f83e1f07] 

Ok, that's what I suspected it did. Some benefits, some drawbacks
(e.g. if you don't have a scroll buffer). I can live with it.

Cheers,

Dave.
diff mbox

Patch

diff --git a/db/print.c b/db/print.c
index 998daf4..e31372f 100644
--- a/db/print.c
+++ b/db/print.c
@@ -197,7 +197,7 @@  print_sarray(
 	     i < count && !seenint();
 	     i++, bitoff += size) {
 		if (array)
-			dbprintf("%d:", i + base);
+			dbprintf("\n%d:", i + base);
 		for (f = flds, first = 1; f->name; f++) {
 			if (f->flags & FLD_SKIPALL)
 				continue;