From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v2 2/4] libxc/xentrace: Replace xc_tbuf_set_cpu_mask with CPU mask with xc_cpumap_t instead of uint32_t Date: Mon, 16 Jun 2014 09:43:35 -0400 Message-ID: <20140616134335.GB9821@laptop.dumpdata.com> References: <1402692084-931-1-git-send-email-konrad.wilk@oracle.com> <1402692084-931-3-git-send-email-konrad.wilk@oracle.com> <539EF174.6040509@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <539EF174.6040509@eu.citrix.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: George Dunlap Cc: ian.jackson@eu.citrix.com, ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Jun 16, 2014 at 02:30:28PM +0100, George Dunlap wrote: > On 06/13/2014 09:41 PM, Konrad Rzeszutek Wilk wrote: > >We replace the implementation of xc_tbuf_set_cpu_mask with > >an xc_cpumap_t instead of a uint32_t. This means we can use an > >arbitrary bitmap without being limited to the 32-bits as > >previously we were. Furthermore since there is only one > >user of xc_tbuf_set_cpu_mask we just replace it and > >its user in one go. > > > >We also add an macro which can be used by both libxc and > >xentrace. > > > >And update the man page to describe this behavior. > > > >Signed-off-by: Konrad Rzeszutek Wilk > > xentrace side looks good to me, with one minor thing... > > >@@ -513,23 +513,66 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num, > > return &tbufs; > > } > >+void print_cpu_mask(xc_cpumap_t mask, int bits) > >+{ > >+ unsigned int v, had_printed = 0; > >+ int i; > >+ > >+ fprintf(stderr, "change cpumask to 0x"); > >+ > >+ for ( i = DIV_ROUND_UP(bits, 8); i >= 0; i-- ) > >+ { > >+ v = mask[i]; > >+ if ( v || had_printed ) { > >+ fprintf(stderr,"%x", v); > >+ had_printed = 1; > >+ } > >+ } > >+ fprintf(stderr, "\n"); > > If I'm reading this right, if the user enters "-c 0x0", the output of this > will be as follows: > > change cpumask to 0x > > Maybe we should add "i==0" (or "!i") to the conditions under which it will > print the mask? Will do in the next posting! > > -George >