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 6BCADA00C4; Fri, 24 Apr 2020 07:34:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B6EB1C1C0; Fri, 24 Apr 2020 07:34:43 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9B8181C1BD for ; Fri, 24 Apr 2020 07:34:41 +0200 (CEST) IronPort-SDR: WSGC+sZZnY2uiV5EmkqfjTaNV9tPdniBBwrLIfAYB5jzkuFbwmndVhBsoEn3HZkYoDowVaDpwH CLaJsyWx/nqQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 22:34:40 -0700 IronPort-SDR: TR2QjEZm1daTPMYT8pDxAEumF7OJSCLYZqU/z8eYGcRyzUKGlulcfAoaZYx334m3y3HTCNoOx4 fGTc0tD9G87g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,310,1583222400"; d="scan'208";a="256258044" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 23 Apr 2020 22:34:40 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Apr 2020 22:34:11 -0700 Received: from cdsmsx101.ccr.corp.intel.com (172.17.3.36) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Apr 2020 22:34:10 -0700 Received: from cdsmsx102.ccr.corp.intel.com ([169.254.2.104]) by CDSMSX101.ccr.corp.intel.com ([169.254.1.77]) with mapi id 14.03.0439.000; Fri, 24 Apr 2020 13:34:08 +0800 From: "Jiang, MaoX" To: "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] nics/system_info: _strip_memory adapt new output Thread-Index: AQHWGe2v2v6e54Ro7k67YiUURYgzf6iHvnMwgAAAU1A= Date: Fri, 24 Apr 2020 05:34:08 +0000 Message-ID: <79BEEF5375D8C04B84B9FF07CBE5ED8716523D19@CDSMSX102.ccr.corp.intel.com> References: <1587699137-89442-1-git-send-email-yux.jiang@intel.com> <50bf0a9a2ccf4bdab3befeac80613bdf@intel.com> <60652C6914E08D41B9AA1580751B3CA9015EF9BE@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <60652C6914E08D41B9AA1580751B3CA9015EF9BE@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.6.105] 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" Tested-by: "Jiang,mao" > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jiang, YuX > > Sent: Friday, April 24, 2020 12:05 PM > > To: dts@dpdk.org > > Subject: Re: [dts] [PATCH V1] nics/system_info: _strip_memory adapt > > new output > > > > Tested-by: "Jiang,yu" > > > > -----Original Message----- > > From: 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 > > > > From: "Jiang,yu" > > > > adapt the new output of memory info > > > > Signed-off-by: Jiang,yu > > --- > > nics/system_info.py | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > 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