[V1] tests/crypto_perf_cryptodev_perf: optimize parse output
diff mbox series

Message ID 20200729075436.21401-1-yux.jiang@intel.com
State Accepted
Headers show
Series
  • [V1] tests/crypto_perf_cryptodev_perf: optimize parse output
Related show

Commit Message

Jiang, YuX July 29, 2020, 7:54 a.m. UTC
From: "Jiang,yu" <yux.jiang@intel.com>

Optimize the output of perf test results log

Signed-off-by: Jiang,yu <yux.jiang@intel.com>
---
 tests/TestSuite_crypto_perf_cryptodev_perf.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jiang, YuX July 31, 2020, 5:15 a.m. UTC | #1
Tested-by:  Jiang, YuX <yux.jiang@intel.com>

-----Original Message-----
From: Jiang, YuX 
Sent: Wednesday, July 29, 2020 3:55 PM
To: dts@dpdk.org
Cc: Jiang, YuX <yux.jiang@intel.com>; Jiang
Subject: [dts][PATCH V1] tests/crypto_perf_cryptodev_perf: optimize parse output

From: "Jiang,yu" <yux.jiang@intel.com>

Optimize the output of perf test results log

Signed-off-by: Jiang,yu <yux.jiang@intel.com>
---
 tests/TestSuite_crypto_perf_cryptodev_perf.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_crypto_perf_cryptodev_perf.py b/tests/TestSuite_crypto_perf_cryptodev_perf.py
index e1780f5..fb9f2e0 100644
--- a/tests/TestSuite_crypto_perf_cryptodev_perf.py
+++ b/tests/TestSuite_crypto_perf_cryptodev_perf.py
@@ -268,14 +268,15 @@ class PerfTestsCryptodev(TestCase):
                 if lines[line_index].startswith("    lcore id"):
                     self.logger.debug("data output line from: " + str(line_index))
                     break
+            data_line = line_index - 2
 
             results = []
             pattern = re.compile(r'\s+')
-            for line in lines[line_index:]:
+            for line in lines[data_line:-1]:
                 print(line)
                 result = {}
                 result_list = pattern.split(line.strip(" "))
-                if result_list[0] == "lcore id" or result_list[0] == "lcore" or not result_list[0]:
+                if len(result_list) != 10 or result_list[0] == "lcore" or not result_list[0]:
                     continue
                 result["lcore_id"] = int(result_list[0])
                 result["buf_size"] = int(result_list[1])
Tu, Lijuan Aug. 12, 2020, 6:59 a.m. UTC | #2
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Jiang, YuX
> Sent: 2020年7月29日 15:55
> To: dts@dpdk.org
> Cc: Jiang, YuX <yux.jiang@intel.com>; Jiang@dpdk.org
> Subject: [dts] [PATCH V1] tests/crypto_perf_cryptodev_perf: optimize parse
> output
> 
> Optimize the output of perf test results log
> 
> Signed-off-by: Jiang,yu <yux.jiang@intel.com>
> ---
>  tests/TestSuite_crypto_perf_cryptodev_perf.py | 5 +++--

Applied

Patch
diff mbox series

diff --git a/tests/TestSuite_crypto_perf_cryptodev_perf.py b/tests/TestSuite_crypto_perf_cryptodev_perf.py
index e1780f5..fb9f2e0 100644
--- a/tests/TestSuite_crypto_perf_cryptodev_perf.py
+++ b/tests/TestSuite_crypto_perf_cryptodev_perf.py
@@ -268,14 +268,15 @@  class PerfTestsCryptodev(TestCase):
                 if lines[line_index].startswith("    lcore id"):
                     self.logger.debug("data output line from: " + str(line_index))
                     break
+            data_line = line_index - 2
 
             results = []
             pattern = re.compile(r'\s+')
-            for line in lines[line_index:]:
+            for line in lines[data_line:-1]:
                 print(line)
                 result = {}
                 result_list = pattern.split(line.strip(" "))
-                if result_list[0] == "lcore id" or result_list[0] == "lcore" or not result_list[0]:
+                if len(result_list) != 10 or result_list[0] == "lcore" or not result_list[0]:
                     continue
                 result["lcore_id"] = int(result_list[0])
                 result["buf_size"] = int(result_list[1])