ChangeSet 1.1320, 2005/03/18 11:16:56+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx
Don't print unwieldy array/histogram perfcounters by default.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
tools/misc/xenperf.c | 29 ++++++++++++++++++++++-------
xen/common/perfc.c | 6 ------
2 files changed, 22 insertions(+), 13 deletions(-)
diff -Nru a/tools/misc/xenperf.c b/tools/misc/xenperf.c
--- a/tools/misc/xenperf.c 2005-03-18 11:03:44 -05:00
+++ b/tools/misc/xenperf.c 2005-03-18 11:03:44 -05:00
@@ -22,18 +22,32 @@
{
int i, j, xc_handle;
xc_perfc_desc_t *pcd;
- unsigned int num, sum, reset = 0;
+ unsigned int num, sum, reset = 0, full = 0;
if ( argc > 1 )
{
char *p = argv[1];
- if ( (*p++ == '-') && (*p == 'r') )
- reset = 1;
+ if ( p[0] == '-' )
+ {
+ switch ( p[1] )
+ {
+ case 'f':
+ full = 1;
+ break;
+ case 'r':
+ reset = 1;
+ break;
+ default:
+ goto error;
+ }
+ }
else
{
+ error:
printf("%s: [-r]\n", argv[0]);
- printf("no args: print xen performance counters\n");
- printf(" -r : reset xen performance counters\n");
+ printf("no args: print digested counters\n");
+ printf(" -f : print full arrays/histograms\n");
+ printf(" -r : reset counters\n");
return 0;
}
}
@@ -94,8 +108,9 @@
sum += pcd[i].vals[j];
printf ("T=%10u ", (unsigned int)sum);
- for ( j = 0; j < pcd[i].nr_vals; j++ )
- printf(" %10u", (unsigned int)pcd[i].vals[j]);
+ if ( full || (pcd[i].nr_vals <= 4) )
+ for ( j = 0; j < pcd[i].nr_vals; j++ )
+ printf(" %10u", (unsigned int)pcd[i].vals[j]);
printf("\n");
}
diff -Nru a/xen/common/perfc.c b/xen/common/perfc.c
--- a/xen/common/perfc.c 2005-03-18 11:03:44 -05:00
+++ b/xen/common/perfc.c 2005-03-18 11:03:44 -05:00
@@ -66,12 +66,6 @@
for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
sum += atomic_read(&counters[j]);
printk("TOTAL[%10d] ", sum);
- for ( j = 0; j < perfc_info[i].nr_elements; j++ )
- {
- if ( (j != 0) && ((j % 4) == 0) )
- printk("\n ");
- printk("ARR%02d[%10d] ", j, atomic_read(&counters[j]));
- }
counters += j;
break;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog
|