Skip to contentSkip to conversation

xfs_db: add header to freesp -d output

PATCH In review Eric Sandeen 5 participants 5 messages Aug 21, 2013 – Aug 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_db: add header to freesp -d output

Today, xfs_db's freesp -d command dumps out a bunch of numbers:

# xfs_db -c "freesp -d" /dev/sdb1
       0        4        1
       0        5        1
       0        6        1
       0        7        1
       0       12   174772
...

which are not useful to the non-code-reading user. Add some headers:

# xfs_db -c "freesp -d" /dev/sdb1
    agno    agbno      len
       0        4        1
       0        5        1
       0        6        1
       0        7        1
       0       12   174772
...

so there's at least some context.

---

p.s. - If folks want different strings, I'm game.

db/freesp.c +4 -0
index 6f69eba..361fa96 100644
@@ -96,6 +96,10 @@ freesp_f(
 
 	if (!init(argc, argv))
 		return 0;
+
+	if (dumpflag)
+		dbprintf("%8s %8s %8s\n", "agno", "agbno", "len");
+
 	for (agno = 0; agno < mp->m_sb.sb_agcount; agno++)  {
 		if (inaglist(agno))
 			scan_ag(agno);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

On Wed, Aug 21, 2013 at 05:40:47PM -0500, Eric Sandeen wrote:

| Today, xfs_db's freesp -d command dumps out a bunch of numbers:
| 
| # xfs_db -c "freesp -d" /dev/sdb1
|        0        4        1
|        0        5        1
|        0        6        1
|        0        7        1
|        0       12   174772
| ...
| 
| which are not useful to the non-code-reading user.
| Add some headers:
| 
| # xfs_db -c "freesp -d" /dev/sdb1
|     agno    agbno      len
|        0        4        1
|        0        5        1
|        0        6        1
|        0        7        1
|        0       12   174772
| ...
| 
| so there's at least some context.
| 
| Signed-off-by: Eric Sandeen <[email protected]>
| ---
| 
| p.s. - If folks want different strings, I'm game.

The format is consistent with the "dumpflag" format in addtohist(). I like your choice of strings, except I suggest "length" in place of "len". The space is available.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#2 lore raw
In reply to Eric Sandeen
Quoted 22 lines · Eric Sandeen

Today, xfs_db's freesp -d command dumps out a bunch of numbers:

# xfs_db -c "freesp -d" /dev/sdb1
        0        4        1
        0        5        1
        0        6        1
        0        7        1
        0       12   174772
...

which are not useful to the non-code-reading user. Add some headers:

# xfs_db -c "freesp -d" /dev/sdb1
     agno    agbno      len
        0        4        1
        0        5        1
        0        6        1
        0        7        1
        0       12   174772
...
Quoted 6 lines

so there's at least some context.

---

p.s. - If folks want different strings, I'm game.

Seems like just yesterday, some reviewer was concerned about the verbosity of table headers... wait it was yesterday! Gawd, I love irony. :)

Geoffrey comment len -> length is fine too.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 25 lines · Mark Tinguely
Quoted 24 lines · Eric Sandeen

Today, xfs_db's freesp -d command dumps out a bunch of numbers:

# xfs_db -c "freesp -d" /dev/sdb1
        0        4        1
        0        5        1
        0        6        1
        0        7        1
        0       12   174772
...

which are not useful to the non-code-reading user. Add some headers:

# xfs_db -c "freesp -d" /dev/sdb1
     agno    agbno      len
        0        4        1
        0        5        1
        0        6        1
        0        7        1
        0       12   174772
...

so there's at least some context.

Quoted 8 lines
Quoted 4 lines

---

p.s. - If folks want different strings, I'm game.

Seems like just yesterday, some reviewer was concerned about the verbosity of table headers... wait it was yesterday! Gawd, I love irony. :)

I'd submit that this case is a bit different - there is no context whatsoever to the table of numbers, and there will almost certainly be a very high data::header ratio. :)

Quoted 3 lines

Geoffrey comment len -> length is fine too.

Thanks for the review,

-Eric

Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs