[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 03/10] vnuma hook to debug-keys u



>>> On 18.07.14 at 07:50, <ufimtseva@xxxxxxxxx> wrote:
> @@ -389,6 +389,33 @@ static void dump_numa(unsigned char key)
>  
>               for_each_online_node(i)
>                       printk("    Node %u: %u\n", i, page_num_node[i]);
> +
> +             if ( d->vnuma ) {
> +                     printk("    Domain has %u vnodes, %u vcpus\n", 
> d->vnuma->nr_vnodes, d->max_vcpus);
> +                     for ( i = 0; i < d->vnuma->nr_vnodes; i++ ) {
> +                             err = snprintf(keyhandler_scratch, 12, "%u", 
> d->vnuma->vnode_to_pnode[i]);
> +                             if ( err < 0 )
> +                                     printk("        vnode %u - pnode %s,", 
> i, "any");

"any"? This is more like "unknown" or "???".

> +                             else
> +                                     printk("        vnode %u - pnode %s,", 
> i,
> +                             d->vnuma->vnode_to_pnode[i] == NUMA_NO_NODE ? 
> "any" : keyhandler_scratch);
> +                             printk(" %"PRIu64" MB, ",
> +                                     (d->vnuma->vmemrange[i].end - 
> d->vnuma->vmemrange[i].start) >> 20);
> +                             printk("vcpu nums: ");

By strcpy()ing into keyhandler_scratch in the special case paths above
you could collapse all three printk()s into one.

> +                             for ( j = 0, n = 0; j < d->max_vcpus; j++ ) {
> +                                     if ( d->vnuma->vcpu_to_vnode[j] == i ) {
> +                                             if ( ((n + 1) % 8) == 0 )
> +                                                     printk("%d\n", j);
> +                                             else if ( !(n % 8) && n != 0 )
> +                                                     printk("%s%d ", "       
>       ", j);
> +                                             else
> +                                                     printk("%d ", j);
> +                                     n++;

Indentation.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.