[dts] [PATCH V1 2/2] update this module to support single cpu env

Yao, BingX Y bingx.y.yao at intel.com
Thu Jul 4 04:43:47 CEST 2019


Tested-by: Yao, BingX Y <bingx.y.yao at intel.com>

-----Original Message-----
From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of xiao,qimai
Sent: Thursday, July 4, 2019 10:47 AM
To: dts at dpdk.org
Cc: Xiao, QimaiX <qimaix.xiao at intel.com>
Subject: [dts] [PATCH V1 2/2] update this module to support single cpu env

fix regular expression of Locator to support both multi-core and single-core cpu

Signed-off-by: xiao,qimai <qimaix.xiao at intel.com>
---
 nics/system_info.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nics/system_info.py b/nics/system_info.py index c813cd4..c4fea66 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -77,7 +77,7 @@ class SystemInfo(object):
         Size: 8192 MB Locator: DIMM_A1 Speed: 2133 MHz
         """
         s_regex = r"(\s+)Size: (\d+) MB"
-        l_regex= r"(\s+)Locator: .*_(\w+)"
+        l_regex= r"(\s+)Locator: (CPU\d+_|)(\w+)"
         speed_regex = r"(\s+)Speed: (.*)"
         size = ""
         locate = ""
@@ -92,7 +92,7 @@ class SystemInfo(object):
                 size = m.group(2)
             l_m = re.match(l_regex, line)
             if l_m:
-                locate = l_m.group(2)
+                locate = l_m.group(3)
             s_m = re.match(speed_regex, line)
             if s_m:
                 speed = s_m.group(2)
--
2.17.1



More information about the dts mailing list