From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Jiang, YuX" <yux.jiang@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Jiang, YuX" <yux.jiang@intel.com>
Subject: Re: [dts] [PATCH V1] nics/system_info: _strip_memory adapt new output
Date: Fri, 24 Apr 2020 06:41:22 +0000 [thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0F991@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1587699137-89442-1-git-send-email-yux.jiang@intel.com>
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 <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
prev parent reply other threads:[~2020-04-24 6:43 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
2020-04-24 5:54 ` Jiang, MaoX
2020-04-24 6:41 ` Tu, Lijuan [this message]
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=8CE3E05A3F976642AAB0F4675D0AD20E0BC0F991@SHSMSX101.ccr.corp.intel.com \
--to=lijuan.tu@intel.com \
--cc=dts@dpdk.org \
--cc=yux.jiang@intel.com \
/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).