From: Wei Liu Subject: Re: [PATCH v2 01/19] xen: dump vNUMA information with debug key "u" Date: Tue, 9 Dec 2014 11:22:09 +0000 Message-ID: <20141209112209.GC25749@zion.uk.xensource.com> References: <1417448023-27311-1-git-send-email-wei.liu2@citrix.com> <1417448023-27311-2-git-send-email-wei.liu2@citrix.com> <5485E779020000780004DE1F@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5485E779020000780004DE1F@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Wei Liu , ian.campbell@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, ufimtseva@gmail.com, boris.ostrovsky@oracle.com List-Id: xen-devel@lists.xenproject.org On Mon, Dec 08, 2014 at 05:01:29PM +0000, Jan Beulich wrote: [...] > > + for ( i = 0; i < vnuma->nr_vnodes; i++ ) > > + { > > + err = snprintf(keyhandler_scratch, 12, "%3u", > > + vnuma->vnode_to_pnode[i]); > > + if ( err < 0 || vnuma->vnode_to_pnode[i] == NUMA_NO_NODE ) > > + strlcpy(keyhandler_scratch, "???", 3); > > + > > + printk(" vnode %3u - pnode %s\n", i, keyhandler_scratch); > > + for ( j = 0; j < vnuma->nr_vmemranges; j++ ) > > + { > > + if ( vnuma->vmemrange[j].nid == i ) > > + { > > + mem = vnuma->vmemrange[j].end - vnuma->vmemrange[j].start; > > + printk("%16"PRIu64" MB: %#016"PRIx64" - %#016"PRIx64"\n", > > Am I misremembering that these were just "0x%"PRIx64 originally? Yes. > I ask because converting to the 0-padded fixed width form makes > no sense together with the # modifier. For these ranges I think it's OK. > quite obvious that the numbers are hex, so I'd suggest dropping > the #s without replacement. And to be honest I'm also against > printing duplicate information: The memory range already specifies > how much memory this is. > Is this what you want? + if ( vnuma->vmemrange[j].nid == i ) + { + printk(" %016"PRIx64" - %016"PRIx64"\n", + vnuma->vmemrange[j].start, + vnuma->vmemrange[j].end); + } And it prints out something like: (XEN) 2 vnodes, 2 vcpus: (XEN) vnode 0 - pnode 0 (XEN) 0000000000000000 - 00000000bb800000 (XEN) vcpus: 0 Wei.