From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [119.145.14.64]) by dpdk.org (Postfix) with ESMTP id 8CF92AF87 for ; Thu, 29 May 2014 09:49:18 +0200 (CEST) Received: from 172.24.2.119 (EHLO szxeml212-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BWD42883; Thu, 29 May 2014 15:49:11 +0800 (CST) Received: from SZXEML451-HUB.china.huawei.com (10.82.67.194) by szxeml212-edg.china.huawei.com (172.24.2.181) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 29 May 2014 15:48:22 +0800 Received: from [127.0.0.1] (10.177.16.142) by szxeml451-hub.china.huawei.com (10.82.67.194) with Microsoft SMTP Server id 14.3.158.1; Thu, 29 May 2014 15:48:22 +0800 Message-ID: <5386E642.10805@huawei.com> Date: Thu, 29 May 2014 15:48:18 +0800 From: Shannon Zhao User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Thomas Monjalon References: <1401344699-7432-1-git-send-email-zhaoshenglong@huawei.com> <2140757.fj3Ic02JMu@xps13> In-Reply-To: <2140757.fj3Ic02JMu@xps13> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] cpu_layout.py: adjust output format to align X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 07:49:20 -0000 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