From: "Jan Beulich" Subject: Re: [PATCH v3 01/19] xen: dump vNUMA information with debug key "u" Date: Wed, 14 Jan 2015 15:04:14 +0000 Message-ID: <54B6937E0200007800054F3E@mail.emea.novell.com> References: <1421151107-20842-1-git-send-email-wei.liu2@citrix.com> <1421151107-20842-2-git-send-email-wei.liu2@citrix.com> <54B5704B.1010805@citrix.com> <20150113205151.GB17391@zion.uk.xensource.com> <54B64DA4.2080900@citrix.com> <54B65FEC0200007800054BDD@mail.emea.novell.com> <54B656D5.1090007@citrix.com> <20150114120214.GC4226@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150114120214.GC4226@zion.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Wei Liu Cc: dario.faggioli@citrix.com, Elena Ufimsteva , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 14.01.15 at 13:02, wrote: > On Wed, Jan 14, 2015 at 11:45:25AM +0000, Andrew Cooper wrote: >> On 14/01/15 11:24, Jan Beulich wrote: >> >>>> On 14.01.15 at 12:06, wrote: >> >> May I suggest the following sylistic changes: >> >> >> >> 2 vnodes, 20 vcpus: >> >> 1: pnode 0, vcpus {1-9} >> >> 0000000000000000 - 000000005dc00000 >> >> 2: pnode 1, vcpus {10-20} >> >> 000000005dc00000 - 00000000bb000000 >> >> 0000000100000000 - 0000000100800000 >> >> >> >> You have already stated 2 vnodes, so "vnode $X" is redundant as the list >> >> index. The vcpus are exceedingly likely to be consecutively allocated, >> >> and cpumask_scnprintf() is a very concise way of representing them (and >> >> will reduce your code quite a bit). >> > You mean bitmap_scnprintf() - cpumask_scnprintf() is not suitable for >> > dealing with vCPU-s. >> >> Yes, although I was actually thinking of the scnlistprintf() variant. >> >> However, I further notice that the source data is not in an appropriate >> form, so it is perhaps a less sensible suggestion. >> > > Yes. I need to rearrange source data into bitmaps. And that seems to > involve dynamic memory allocation (?) that I would like to avoid in key > handler. > > I adopt other suggestions you made. I also increased the output width to > 4 for every number in case we have 3-digit number in the future. Now the > output looks like: > > (XEN) Domain 1 (total: 768064): > (XEN) Node 0: 768064 > (XEN) 2 vnodes, 20 vcpus, guest physical layout: > (XEN) 0: pnode 0 > (XEN) 0000000000000000 - 000000005dc00000 > (XEN) vcpus: 0 1 2 3 4 5 6 7 > (XEN) 8 9 > (XEN) 1: pnode 0 > (XEN) 000000005dc00000 - 00000000bb000000 > (XEN) 0000000100000000 - 0000000100800000 > (XEN) vcpus: 10 11 12 13 14 15 16 17 > (XEN) 18 19 As said in an earlier reply, I think you should still aim at printing "vcpus: {0-9}" and alike instead of the individual enumeration you use right now. Jan