From: Shannon Zhao <zhaoshenglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Thomas Monjalon
<thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH v2] cpu_layout.py: adjust output format to align
Date: Thu, 29 May 2014 15:48:18 +0800 [thread overview]
Message-ID: <5386E642.10805@huawei.com> (raw)
In-Reply-To: <2140757.fj3Ic02JMu@xps13>
Hi Thomas,
Thanks for your advice.
I'll modify the patch and send it as 'patch v3' later.
On 2014/5/29 15:22, Thomas Monjalon wrote:
> Hi Shannon,
>
> I feel this version is better but it's really complicated to read.
>
>> +max_processor_len=len(str(len(cores)*len(sockets)*2-1))
>> +max_core_map_len = max_processor_len*2+4
>> +if max_core_map_len < 12:
>> + max_core_map_len = 12
>
> This line is not indented as the other ones.
>
>> +max_core_id_len=len(str(max(cores)))
>> +
>> +print " ".ljust(max_core_id_len+5),
>> for s in sockets:
>> - print "\tSocket %s" % s,
>> + print "Socket %s" % str(s).ljust(max_core_map_len-7),
>> print ""
>> +print " ".ljust(max_core_id_len+5),
>
> Could you replace all these numbers by something meaningful and easier to
> understand?
> Example: 5 can be replaced by len('Core ')
>
> Other comment: please add spaces around operators (= + - *).
>
> Thanks
>
--
Shannon
next prev parent reply other threads:[~2014-05-29 7:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 6:24 [PATCH v2] cpu_layout.py: adjust output format to align Shannon Zhao
[not found] ` <1401344699-7432-1-git-send-email-zhaoshenglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-05-29 7:22 ` Thomas Monjalon
2014-05-29 7:48 ` Shannon Zhao [this message]
2014-06-18 4:18 ` [PATCH v3] " Shannon Zhao
[not found] ` <1403065095-11092-1-git-send-email-zhaoshenglong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-06-18 18:17 ` De Lara Guarch, Pablo
[not found] ` <E115CCD9D858EF4F90C690B0DCB4D897082CC037-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-18 23:03 ` 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=5386E642.10805@huawei.com \
--to=zhaoshenglong-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
--cc=thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@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.