From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19E3FA00C2; Fri, 24 Apr 2020 08:43:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 085C61C1CA; Fri, 24 Apr 2020 08:43:00 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 25E751C1C8 for ; Fri, 24 Apr 2020 08:42:58 +0200 (CEST) IronPort-SDR: jgyRdvpbQt4mJY4EqNfkZB35dOo9k5AHXhokilh6iBrDgquZ7iD3b0CgX8JBAKv3NSDKRFy++h o5KEXBb9sCAQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 23:42:58 -0700 IronPort-SDR: TomCV7LqvkB4KjUF8mxDCYym1V7lbk8I5HddxrINmDNC10DhcsnwUGsolOmM0We1JcNuZ5ox3M RkH2f1xl7ohA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,310,1583222400"; d="scan'208";a="301463730" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 23 Apr 2020 23:42:56 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Apr 2020 23:41:24 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Apr 2020 23:41:24 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Fri, 24 Apr 2020 14:41:22 +0800 From: "Tu, Lijuan" To: "Jiang, YuX" , "dts@dpdk.org" CC: "Jiang, YuX" Thread-Topic: [dts] [PATCH V1] nics/system_info: _strip_memory adapt new output Thread-Index: AQHWGeoO1NOfy5nFV0GFv3eBXoOZsKiH0uUA Date: Fri, 24 Apr 2020 06:41:22 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0F991@SHSMSX101.ccr.corp.intel.com> References: <1587699137-89442-1-git-send-email-yux.jiang@intel.com> In-Reply-To: <1587699137-89442-1-git-send-email-yux.jiang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] nics/system_info: _strip_memory adapt new output X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jiang, YuX > Sent: Friday, April 24, 2020 11:32 AM > To: dts@dpdk.org > Cc: Jiang, YuX > Subject: [dts] [PATCH V1] nics/system_info: _strip_memory adapt new > output >=20 > From: "Jiang,yu" >=20 > adapt the new output of memory info >=20 > Signed-off-by: Jiang,yu > --- > nics/system_info.py | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/nics/system_info.py b/nics/system_info.py index > da73b9f..5f796be 100644 > --- a/nics/system_info.py > +++ b/nics/system_info.py > @@ -75,9 +75,12 @@ class SystemInfo(object): > def _strip_memory(self, memories): > """ > Size: 8192 MB Locator: DIMM_A1 Speed: 2133 MHz > + Size: 32 GB Locator: DIMMB1 Speed: 2400 MT/s > """ > s_regex =3D r"(\s+)Size: (\d+) MB" > + s_regex_gb =3D r"(\s+)Size: (\d+) GB" > l_regex=3D r"(\s+)Locator: .*_(\w+)" > + l_regex_x=3D r"(\s+)Locator:.*DIMM(\w+)" > speed_regex =3D r"(\s+)Speed: (.*)" > size =3D "" > locate =3D "" > @@ -88,11 +91,17 @@ class SystemInfo(object): > total_size =3D 0 > for line in lines: > m =3D re.match(s_regex, line) > + m_gb =3D re.match(s_regex_gb, line) > if m: > size =3D m.group(2) > + elif m_gb: > + size =3D m_gb.group(2)*1024 > l_m =3D re.match(l_regex, line) > + l_mx =3D re.match(l_regex_x, line) > if l_m: > locate =3D l_m.group(2) > + elif l_mx: > + locate =3D l_mx.group(2) > s_m =3D re.match(speed_regex, line) > if s_m: > speed =3D s_m.group(2) > -- > 2.17.2