* [PATCH] xfs/021: filter out detailed array element info from xfs_db
@ 2016-11-04 16:16 Eryu Guan
2016-11-05 5:51 ` Zorro Lang
0 siblings, 1 reply; 3+ messages in thread
From: Eryu Guan @ 2016-11-04 16:16 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs, Eryu Guan
Starting from xfsprogs commit 384283555871 ("xfs_db: print one array
element per line"), xfs_db prints one array element per line. This
breaks the filter in xfs/021, which now fails as:
hdr.freemap[0-2] = [base,size] [FREEMAP..]
+0:[104,1892]
+1:[0,0]
+2:[0,0]
entries[0-2] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]
So we have extra lines that need to be filtered out,
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
tests/xfs/021 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/xfs/021 b/tests/xfs/021
index 67a4346..b99eff7 100755
--- a/tests/xfs/021
+++ b/tests/xfs/021
@@ -151,7 +151,7 @@ s/^(hdr.info.magic =) 0x3bee/\1 0xfbee/;
s/^(hdr.firstused =) (\d+)/\1 FIRSTUSED/;
s/^(hdr.freemap\[0-2] = \[base,size]).*/\1 [FREEMAP..]/;
s/^(entries\[0-2] = \[hashval,nameidx,incomplete,root,local]).*/\1 [ENTRIES..]/;
- print;'
+ print unless /^[0-9]/;'
echo "*** done"
exit
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs/021: filter out detailed array element info from xfs_db
2016-11-04 16:16 [PATCH] xfs/021: filter out detailed array element info from xfs_db Eryu Guan
@ 2016-11-05 5:51 ` Zorro Lang
2016-11-06 4:34 ` Eryu Guan
0 siblings, 1 reply; 3+ messages in thread
From: Zorro Lang @ 2016-11-05 5:51 UTC (permalink / raw)
To: Eryu Guan; +Cc: fstests, linux-xfs
On Sat, Nov 05, 2016 at 12:16:10AM +0800, Eryu Guan wrote:
> Starting from xfsprogs commit 384283555871 ("xfs_db: print one array
> element per line"), xfs_db prints one array element per line. This
> breaks the filter in xfs/021, which now fails as:
>
> hdr.freemap[0-2] = [base,size] [FREEMAP..]
> +0:[104,1892]
> +1:[0,0]
> +2:[0,0]
Hmm... So [FREEMAP..] was printed in one line, but now every records
will take one line.
> entries[0-2] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]
>
> So we have extra lines that need to be filtered out,
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
> tests/xfs/021 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/xfs/021 b/tests/xfs/021
> index 67a4346..b99eff7 100755
> --- a/tests/xfs/021
> +++ b/tests/xfs/021
> @@ -151,7 +151,7 @@ s/^(hdr.info.magic =) 0x3bee/\1 0xfbee/;
> s/^(hdr.firstused =) (\d+)/\1 FIRSTUSED/;
> s/^(hdr.freemap\[0-2] = \[base,size]).*/\1 [FREEMAP..]/;
So this line script trys to deal with all freemap things, but now it
can't deal with multi-lines output. (Same as below)
> s/^(entries\[0-2] = \[hashval,nameidx,incomplete,root,local]).*/\1 [ENTRIES..]/;
> - print;'
> + print unless /^[0-9]/;'
Filter all lines start with a digit(0~9). It works, but I can't be
sure that if it'll affect others useful error output, maybe more
accurate expression will be better?
Thanks,
Zorro
>
> echo "*** done"
> exit
> --
> 2.7.4
>
> --
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs/021: filter out detailed array element info from xfs_db
2016-11-05 5:51 ` Zorro Lang
@ 2016-11-06 4:34 ` Eryu Guan
0 siblings, 0 replies; 3+ messages in thread
From: Eryu Guan @ 2016-11-06 4:34 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-xfs
On Sat, Nov 05, 2016 at 01:51:11PM +0800, Zorro Lang wrote:
> On Sat, Nov 05, 2016 at 12:16:10AM +0800, Eryu Guan wrote:
> > Starting from xfsprogs commit 384283555871 ("xfs_db: print one array
> > element per line"), xfs_db prints one array element per line. This
> > breaks the filter in xfs/021, which now fails as:
> >
> > hdr.freemap[0-2] = [base,size] [FREEMAP..]
> > +0:[104,1892]
> > +1:[0,0]
> > +2:[0,0]
>
> Hmm... So [FREEMAP..] was printed in one line, but now every records
> will take one line.
>
> > entries[0-2] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]
> >
> > So we have extra lines that need to be filtered out,
> >
> > Signed-off-by: Eryu Guan <eguan@redhat.com>
> > ---
> > tests/xfs/021 | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tests/xfs/021 b/tests/xfs/021
> > index 67a4346..b99eff7 100755
> > --- a/tests/xfs/021
> > +++ b/tests/xfs/021
> > @@ -151,7 +151,7 @@ s/^(hdr.info.magic =) 0x3bee/\1 0xfbee/;
> > s/^(hdr.firstused =) (\d+)/\1 FIRSTUSED/;
> > s/^(hdr.freemap\[0-2] = \[base,size]).*/\1 [FREEMAP..]/;
>
> So this line script trys to deal with all freemap things, but now it
> can't deal with multi-lines output. (Same as below)
>
> > s/^(entries\[0-2] = \[hashval,nameidx,incomplete,root,local]).*/\1 [ENTRIES..]/;
> > - print;'
> > + print unless /^[0-9]/;'
>
> Filter all lines start with a digit(0~9). It works, but I can't be
> sure that if it'll affect others useful error output, maybe more
> accurate expression will be better?
I think it's fine, we only filter stdout here and if there's any error
it should go to stderr and we can still catch it.
Thanks,
Eryu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-06 4:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 16:16 [PATCH] xfs/021: filter out detailed array element info from xfs_db Eryu Guan
2016-11-05 5:51 ` Zorro Lang
2016-11-06 4:34 ` Eryu Guan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox