> Date: Wed, 05 Jul 2006 09:21:21 -0400
> From: Dave Anderson <anderson@redhat.com>
> Subject: Re: [Crash-utility] Crash : To improve readability of mount
> command inCrash.
> To: "Discussion list for crash utility usage, maintenance and
> development" <crash-utility@redhat.com>
> Message-ID: <44ABBCD1.9A3EB28B@redhat.com>
> Content-Type: text/plain; charset="us-ascii"
>
> "Hariharan T.S." wrote:
>
> > Hi All Just a suggestion for improved readablity in crash
for
> mount command.Instead of printing header every time for
> > each line, It can be limited to one header at the top.crash>
mount
> /VFSMOUNT SUPERBLK TYPE DEVNAME DIRNAME1100800
> > 10ec800 rootfs rootfs /VFSMOUNT SUPERBLK TYPE DEVNAME
> DIRNAME1100200 10e9400 ext3 /dev/root /crash> mount
> > /procVFSMOUNT SUPERBLK TYPE DEVNAME DIRNAME1100280 10ec400 proc
> /proc /procVFSMOUNT SUPERBLK TYPE DEVNAME
> > DIRNAME1100f00 10ec400 proc /proc /proccrash> RegardsHariharan
T.S.
>
> What -- no patch to fix it? ;-)
>
> Yeah, those are unique cases, because even though you
> are requesting just one directory via the extra command line
> argument, there are two unique vfsmount entries, i.e,
> the rootfs and ext3 types for the / directory. (I can't
> reproduce the two /proc entries as in your example.)
>
> Anyway, there should be a flag set somewhere to avoid
> the duplicate headers. I'll add it to the crash.TODO list:
>
> http://people.redhat.com/anderson/crash.TODO.html
>
> Thanks,
> Dave
Here is a patch against crash-4.0-25.4 on SLES10_RC3.
===================
From: Lin Feng Shen <shenlinf@cn.ibm.com>
The patch improves readablity in crash for mount command.
Instead of
printing header for each mount point in "mount
[vfsmount | superblock
| devname | dirname | inode]", it showes
an unique one.
Signed-off-by: Lin Feng Shen <shenlinf@cn.ibm.com>
---
diff -upNr crash-4.0-2.18.orig/filesys.c crash-4.0-2.18/filesys.c
--- crash-4.0-2.18.orig/filesys.c
2006-07-05 23:46:09.000000000 -0400
+++ crash-4.0-2.18/filesys.c
2006-07-05 23:53:41.000000000 -0400
@@ -1144,6 +1144,7 @@ cmd_mount(void)
ulong
vfsmount = 0;
int
flags = 0;
int
save_next;
+
int unique_mount_hdr=0;
while ((c = getopt(argcnt, args, "if"))
!= EOF) {
switch(c)
@@ -1202,7 +1203,10 @@ cmd_mount(void)
sscanf(buf2,"%lx",&vfsmount);
show_mounts(vfsmount, flags);
}
else {
-
fprintf(fp,
mount_hdr);
+
if
(unique_mount_hdr == 0){
+
fprintf(fp, mount_hdr);
+
unique_mount_hdr = 1;
+
}
fprintf(fp, buf2);
}
found
= FALSE;