Re: [Fuego] [PATCH] fio/parser.py: Add support to parse later versions of Fio 2.16

<[email protected]> Wed, 30 Mar 2022 13:23:47 +0000
Newsgroups dev.linux.lists.fuego
Message-ID <TYCPR01MB6095442C3984E7A051792D39B31F9@TYCPR01MB6095.jpnprd01.prod.outlook.com>
Dear Tim,

I would like to add below change related to Fio parser to Upstream.=20

Kindly review and provide your feedback.


Thanks & Regards
Sireesha

-----Original Message-----
From: [email protected] <[email protected]>=
=20
Sent: Wednesday, March 30, 2022 6:48 PM
To: [email protected]
Cc: nakkala sireesha(=1B$B#T#S#I#P=1B(B) <[email protected]=
>; [email protected]; dinesh kumar(=1B$B#T#S#I#P=1B(B) <dines=
[email protected]>; hayashi kazuhiro(=1B$BNS=1B(B =1B$BOB9(=1B(B =1B=
$B""#S#W#C"~#A#C#T=1B(B) <[email protected]>; pyla venkata(=
=1B$B#T#S#I#P=1B(B) <[email protected]>
Subject: [PATCH] fio/parser.py: Add support to parse later versions of Fio =
2.16

From: sireesha <[email protected]>

The existing parser.py file works for fio version 2.0.8 which is the test v=
ersion defined and used in fuego tests.

As Fio output has changed from 2.16 version, to use fio with fuego the pars=
er is modified to parse the output of Fio version 2.0.8 and later version o=
f 2.16

Signed-off-by: sireesha <[email protected]>
Signed-off-by: venkata pyla <[email protected]>
---
 tests/Benchmark.fio/parser.py | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)  mode change 100755 =3D> =
100644 tests/Benchmark.fio/parser.py

diff --git a/tests/Benchmark.fio/parser.py b/tests/Benchmark.fio/parser.py =
old mode 100755 new mode 100644 index 52a44e5..ef081b5
--- a/tests/Benchmark.fio/parser.py
+++ b/tests/Benchmark.fio/parser.py
@@ -4,13 +4,30 @@
 import os, sys
 import common as plib
=20
-regex_string =3D '(  READ:|  WRITE:)(.*)(aggrb=3D)([\d.]+)([KM]B\/s)'
+regex_string =3D ''
+regex_string_old =3D '(  READ:|  WRITE:)(.*)(aggrb=3D)([\d.]+)([KM]B\/s)'
+regex_string_new =3D '( READ:| WRITE:)(.*)(bw=3D.*)(.*)(\()([\d.]+)([kKM]B=
\/s)(\))'
+
+test_version =3D ''
+with open(plib.TEST_LOG,'r') as cur_file:
+    raw_values =3D cur_file.readlines()
+    test_version =3D raw_values[4].rstrip("\n")
+
+if test_version > '2.16':
+    regex_string =3D regex_string_new
+else:
+    regex_string =3D regex_string_old
+
 measurements =3D {}
=20
 # handle results in MB or KB
 def set_measure(tguid, match):
-    speed =3D match[3]
-    units =3D match[4]
+    if test_version > '2.16':
+        speed =3D match[5]
+        units =3D match[6]
+    else:
+        speed =3D match[3]
+        units =3D match[4]
     multiplier =3D 1
     if units.startswith('M'):
         # WARNING - this depends on the value of kb_base specified to
--
2.20.1