From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap 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 14:30:28 +0100 Message-ID: <539EF174.6040509@eu.citrix.com> References: <1402692084-931-1-git-send-email-konrad.wilk@oracle.com> <1402692084-931-3-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402692084-931-3-git-send-email-konrad.wilk@oracle.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: Konrad Rzeszutek Wilk , xen-devel@lists.xen.org, ian.campbell@citrix.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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? -George