All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Zhao <zhaoshenglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: <dev-VfR2kkLFssw@public.gmane.org>
Subject: [PATCH] cpu_layout.py: adjust output format to align
Date: Tue, 27 May 2014 17:41:25 +0800	[thread overview]
Message-ID: <53845DC5.3000400@huawei.com> (raw)

Bug: when "core id" is greater than 9, the cpu_layout.py output doesn't align.

        Socket 0        Socket 1
        ---------       ---------
Core 9  [4, 16]         [10, 22]

Core 10         [5, 17]         [11, 23]

Solution: adjust output format to align

        Socket 0        Socket 1
        ---------       ---------
Core 9  [4, 16]         [10, 22]

Core 10 [5, 17]         [11, 23]

Signed-off-by: Shannon Zhao <zhaoshenglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 tools/cpu_layout.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/cpu_layout.py b/tools/cpu_layout.py
index 9eff9d7..4768551 100755
--- a/tools/cpu_layout.py
+++ b/tools/cpu_layout.py
@@ -83,7 +83,7 @@ for s in sockets:
 print ""

 for c in cores:
-       print "Core %s" % c,
+       print "Core %s" % str(c).ljust(2),
        for s in sockets:
-               print "\t", core_map[(s,c)],
+               print core_map[(s,c)],"\t",
        print "\n"
--
1.7.1

             reply	other threads:[~2014-05-27  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  9:41 Shannon Zhao [this message]
     [not found] ` <53845DC5.3000400-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-05-27 10:30   ` [PATCH] cpu_layout.py: adjust output format to align Thomas Monjalon
2014-05-28  3:02     ` Shannon Zhao
     [not found]       ` <538551CC.3000108-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-05-28  9:23         ` Thomas Monjalon

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=53845DC5.3000400@huawei.com \
    --to=zhaoshenglong-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.