WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][RFC]xenperf hypercall pretty print

To: Ken Hironaka <hironaka.ken@xxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][RFC]xenperf hypercall pretty print
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Fri, 18 Aug 2006 11:28:24 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 18 Aug 2006 09:28:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1155894487.4637.101.camel@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <1155894487.4637.101.camel@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2006-08-18 at 18:48 +0900, Ken Hironaka wrote:
> 
> +const char* hypercall_name_table[64]=
> +{
> +    "set_trap_table",        //0
> +    "mmu_update",            //1
> +    "set_gdt",               //2 
...

Rather than have all those numbers in the comments, it would be better
to use the C99 array initialization syntax:

const char* hypercall_name_table[64] = {
        [__HYPERVISOR_set_trap_table] = "set_trap_table",
        [__HYPERVISOR_mmu_update] = "mmu_update",
...
};


> @@ -117,10 +185,17 @@ int main(int argc, char *argv[])
>              sum += val[j];
>          printf ("T=%10u ", (unsigned int)sum);
>  
> -        if ( full || (pcd[i].nr_vals <= 4) )
> +        if ( full || (pcd[i].nr_vals <= 4) ){
> +                       if( strcmp(pcd[i].name, "hypercalls") == 0 ){
> +                               for( j = 0; j < pcd[i].nr_vals; j++ )
> +                                       printf("%s\t",
> hypercall_name_table[j]);
> +                               printf("\n");
> +                       }
>              for ( j = 0; j < pcd[i].nr_vals; j++ )
>                  printf(" %10u", (unsigned int)val[j]);
>  
> +               }
> +
>          printf("\n");
>                 val += pcd[i].nr_vals;
>      }

Looks like the whitespace got out of hand here. Please double-check.

Also, it looks like this file has had some tabs creep into it. You
should probably send a tab-removal patch first, then this patch on top
of that.

-- 
Hollis Blanchard
IBM Linux Technology Center


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>