Skip to contentSkip to conversation

generic/294: Filter backquotes from mknod error output

PATCH In review Jan Kara 2 participants 5 messages Jul 21, 2016

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/2 generic/294: Filter backquotes from mknod error output

Really old versions of coreutils (mine are 8.12) quote a filename in the output with a backquote in the beginning and normal quote in the end. Improve _filter_mknod to handle that.

---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +1 -1
index 8d9f489bea1c..b229a97dfa0e 100644
@@ -389,7 +389,7 @@ _filter_od()
 # mknod errors print unquoted filenames
 _filter_mknod()
 {
-	sed -e "s/mknod: '\(.*\)': File exists/mknod: \1: File exists/"
+	sed -e "s/mknod: [\`']\(.*\)': File exists/mknod: \1: File exists/"
 }
 
 # make sure this script returns success
Signature · 1 line
2.6.6
author
#1 lore raw

PATCH 2/2 generic/130: Improve xfs_io filter

On my test setup xfs_io reports 'nan' in bytes/s and ops/s fields when the operation takes zero time. Account for that in _filter_xfs_io.

---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +1 -1
index b229a97dfa0e..37f07c8ca1ac 100644
@@ -221,7 +221,7 @@ common_line_filter()
 
 _filter_xfs_io()
 {
-    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infnan0-9/.]* [EPGMKiBbytes]*\/sec and [infnan0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
 }
 
 _filter_xfs_io_unique()
Signature · 1 line
2.6.6
#2 lore raw

Re: [PATCH 2/2] generic/130: Improve xfs_io filter

Quoted 13 lines · Jan Kara

On my test setup xfs_io reports 'nan' in bytes/s and ops/s fields when the operation takes zero time. Account for that in _filter_xfs_io.

---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +0 -0
index b229a97dfa0e..37f07c8ca1ac 100644

common/filter common_line_filter() · line 224

Quoted 5 lines
common/filter +1 -1
@@ -221,7 +221,7 @@ common_line_filter()
 
 _filter_xfs_io()
 {
-    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infnan0-9/.]* [EPGMKiBbytes]*\/sec and [infnan0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"

Seems adding only 'a' to the char set is sufficient, 'n' is already in the set, i.e.

- ...([inf0-9/.]* ...
+ ...([infa0-9/.]* ...

Thanks,
Eryu

author
#3 lore raw

Re: [PATCH 2/2] generic/130: Improve xfs_io filter

Quoted 23 lines · Eryu Guan
Quoted 13 lines · Jan Kara

On my test setup xfs_io reports 'nan' in bytes/s and ops/s fields when the operation takes zero time. Account for that in _filter_xfs_io.

---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +0 -0
index b229a97dfa0e..37f07c8ca1ac 100644

common/filter common_line_filter() · line 224

Quoted 5 lines
common/filter +1 -1
@@ -221,7 +221,7 @@ common_line_filter()
 
 _filter_xfs_io()
 {
-    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infnan0-9/.]* [EPGMKiBbytes]*\/sec and [infnan0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"

Seems adding only 'a' to the char set is sufficient, 'n' is already in the set, i.e.

Quoted 2 lines

- ...([inf0-9/.]* ...
+ ...([infa0-9/.]* ...

Yeah. I've added 'nan' to document what the letters are there for. But probably I should have added just 'a' and added a comment. I'll respin the patch.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#4 lore raw

Re: [PATCH 2/2] generic/130: Improve xfs_io filter

Quoted 24 lines · Jan Kara
Quoted 23 lines · Eryu Guan
Quoted 13 lines · Jan Kara

On my test setup xfs_io reports 'nan' in bytes/s and ops/s fields when the operation takes zero time. Account for that in _filter_xfs_io.

---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +0 -0
index b229a97dfa0e..37f07c8ca1ac 100644

common/filter common_line_filter() · line 224

Quoted 5 lines
common/filter +1 -1
@@ -221,7 +221,7 @@ common_line_filter()
 
 _filter_xfs_io()
 {
-    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infnan0-9/.]* [EPGMKiBbytes]*\/sec and [infnan0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"

Seems adding only 'a' to the char set is sufficient, 'n' is already in the set, i.e.

Quoted 6 lines
Quoted 2 lines

- ...([inf0-9/.]* ...
+ ...([infa0-9/.]* ...

Yeah. I've added 'nan' to document what the letters are there for. But probably I should have added just 'a' and added a comment. I'll respin the patch.

Attached is a revised patch.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
Quoted 1 line

From 8d86c6fe36040e21db3475292a2dd05a280f158f Mon Sep 17 00:00:00 2001

From: Jan Kara <[email protected]>
Date: Thu, 21 Jul 2016 08:15:19 +0200
Subject: [PATCH] generic/130: Improve xfs_io filter

On my test setup xfs_io reports 'nan' in bytes/s and ops/s fields when the operation takes zero time. Account for that in _filter_xfs_io.

---
 common/filter | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/filter +3 -1
index b229a97dfa0e..f80cd562af71 100644
@@ -221,7 +221,9 @@ common_line_filter()
 
 _filter_xfs_io()
 {
-    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+    # Apart from standard numeric values, we also filter out 'inf' and 'nan'
+    # which can result from division in some cases
+    sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infa0-9/.]* [EPGMKiBbytes]*\/sec and [infa0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
 }
 
 _filter_xfs_io_unique()
Signature · 1 line
2.6.6