From: Hollis Blanchard Subject: Re: [PATCH][RFC]xenperf hypercall pretty print Date: Fri, 18 Aug 2006 11:28:24 -0500 Message-ID: <1155918504.23182.7.camel@basalt.austin.ibm.com> References: <1155894487.4637.101.camel@pingi.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1155894487.4637.101.camel@pingi.sky.yk.fujitsu.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ken Hironaka Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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