test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zhou Jun <junx.w.zhou@intel.com>
To: dts@dpdk.org
Cc: Zhou Jun <junx.w.zhou@intel.com>
Subject: [dts] [PATCH V1] nics/system_info:adapt some environment memory echo unit is GB
Date: Wed, 24 Mar 2021 11:08:37 +0800	[thread overview]
Message-ID: <1616555317-21677-1-git-send-email-junx.w.zhou@intel.com> (raw)

The previous environment memory information unit is MB. 
At present, some new system memory information units are GB,
 and DTS needs to be modified for adaptation.

Signed-off-by: Zhou Jun <junx.w.zhou@intel.com>
---
 nics/system_info.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/nics/system_info.py b/nics/system_info.py
index da73b9f..70fdbf6 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -77,6 +77,7 @@ class SystemInfo(object):
         Size: 8192 MB Locator: DIMM_A1 Speed: 2133 MHz
         """
         s_regex = r"(\s+)Size: (\d+) MB"
+        s1_regex = r"(\s+)Size: (\d+) GB"
         l_regex= r"(\s+)Locator: .*_(\w+)"
         speed_regex = r"(\s+)Speed: (.*)"
         size = ""
@@ -88,8 +89,11 @@ class SystemInfo(object):
         total_size = 0
         for line in lines:
             m = re.match(s_regex, line)
+            m1 = re.match(s1_regex, line)
             if m:
                 size = m.group(2)
+            if m1:
+                size = int(m1.group(2)) * 1024
             l_m = re.match(l_regex, line)
             if l_m:
                 locate = l_m.group(2)
-- 
1.8.3.1


             reply	other threads:[~2021-03-24  3:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  3:08 Zhou Jun [this message]
2021-03-24  3:13 ` Zhou, JunX W
2021-03-25  6:00   ` 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=1616555317-21677-1-git-send-email-junx.w.zhou@intel.com \
    --to=junx.w.zhou@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).