From: "Jiang, MaoX" <maox.jiang@intel.com>
To: "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH V1] nics/system_info: _strip_memory adapt new output
Date: Fri, 24 Apr 2020 05:34:08 +0000 [thread overview]
Message-ID: <79BEEF5375D8C04B84B9FF07CBE5ED8716523D19@CDSMSX102.ccr.corp.intel.com> (raw)
In-Reply-To: <60652C6914E08D41B9AA1580751B3CA9015EF9BE@SHSMSX103.ccr.corp.intel.com>
Tested-by: "Jiang,mao" <maox.jiang@intel.com>
> > -----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" <yux.jiang@intel.com>
> >
> > -----Original Message-----
> > From: Jiang, YuX
> > Sent: Friday, April 24, 2020 11:32 AM
> > To: dts@dpdk.org
> > Cc: Jiang, YuX <yux.jiang@intel.com>
> > Subject: [dts][PATCH V1] nics/system_info: _strip_memory adapt new
> > output
> >
> > From: "Jiang,yu" <yux.jiang@intel.com>
> >
> > adapt the new output of memory info
> >
> > Signed-off-by: Jiang,yu <yux.jiang@intel.com>
> > ---
> > 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 = r"(\s+)Size: (\d+) MB"
> > + s_regex_gb = r"(\s+)Size: (\d+) GB"
> > l_regex= r"(\s+)Locator: .*_(\w+)"
> > + l_regex_x= r"(\s+)Locator:.*DIMM(\w+)"
> > speed_regex = r"(\s+)Speed: (.*)"
> > size = ""
> > locate = ""
> > @@ -88,11 +91,17 @@ class SystemInfo(object):
> > total_size = 0
> > for line in lines:
> > m = re.match(s_regex, line)
> > + m_gb = re.match(s_regex_gb, line)
> > if m:
> > size = m.group(2)
> > + elif m_gb:
> > + size = m_gb.group(2)*1024
> > l_m = re.match(l_regex, line)
> > + l_mx = re.match(l_regex_x, line)
> > if l_m:
> > locate = l_m.group(2)
> > + elif l_mx:
> > + locate = l_mx.group(2)
> > s_m = re.match(speed_regex, line)
> > if s_m:
> > speed = s_m.group(2)
> > --
> > 2.17.2
next prev parent reply other threads:[~2020-04-24 5:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 3:32 Jiang, YuX
2020-04-24 4:05 ` Jiang, YuX
[not found] ` <60652C6914E08D41B9AA1580751B3CA9015EF9BE@SHSMSX103.ccr.corp.intel.com>
2020-04-24 5:34 ` Jiang, MaoX [this message]
2020-04-24 5:54 ` Jiang, MaoX
2020-04-24 6:41 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79BEEF5375D8C04B84B9FF07CBE5ED8716523D19@CDSMSX102.ccr.corp.intel.com \
--to=maox.jiang@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).