ia64/xen-unstable

changeset 4207:8f9f6106eaad

bitkeeper revision 1.1236.1.84 (423ab8a8Ull_l3xygvrErQi9C35RrQ)

Don't print unwieldy array/histogram perfcounters by default.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 18 11:16:56 2005 +0000 (2005-03-18)
parents 53851a0b38e5
children e4563b61d6d2
files tools/misc/xenperf.c xen/common/perfc.c
line diff
     1.1 --- a/tools/misc/xenperf.c	Fri Mar 18 10:47:46 2005 +0000
     1.2 +++ b/tools/misc/xenperf.c	Fri Mar 18 11:16:56 2005 +0000
     1.3 @@ -22,18 +22,32 @@ int main(int argc, char *argv[])
     1.4  {
     1.5      int              i, j, xc_handle;
     1.6      xc_perfc_desc_t *pcd;
     1.7 -    unsigned int     num, sum, reset = 0;
     1.8 +    unsigned int     num, sum, reset = 0, full = 0;
     1.9  
    1.10      if ( argc > 1 )
    1.11      {
    1.12          char *p = argv[1];
    1.13 -        if ( (*p++ == '-')  && (*p == 'r') )
    1.14 -            reset = 1;
    1.15 +        if ( p[0] == '-' )
    1.16 +        {
    1.17 +            switch ( p[1] )
    1.18 +            {
    1.19 +            case 'f':
    1.20 +                full = 1;
    1.21 +                break;
    1.22 +            case 'r':
    1.23 +                reset = 1;
    1.24 +                break;
    1.25 +            default:
    1.26 +                goto error;
    1.27 +            }
    1.28 +        }
    1.29          else
    1.30          {
    1.31 +        error:
    1.32              printf("%s: [-r]\n", argv[0]);
    1.33 -            printf("no args: print xen performance counters\n");
    1.34 -            printf("    -r : reset xen performance counters\n");
    1.35 +            printf("no args: print digested counters\n");
    1.36 +            printf("    -f : print full arrays/histograms\n");
    1.37 +            printf("    -r : reset counters\n");
    1.38              return 0;
    1.39          }
    1.40      }   
    1.41 @@ -94,8 +108,9 @@ int main(int argc, char *argv[])
    1.42              sum += pcd[i].vals[j];
    1.43          printf ("T=%10u ", (unsigned int)sum);
    1.44  
    1.45 -        for ( j = 0; j < pcd[i].nr_vals; j++ )
    1.46 -            printf(" %10u", (unsigned int)pcd[i].vals[j]);
    1.47 +        if ( full || (pcd[i].nr_vals <= 4) )
    1.48 +            for ( j = 0; j < pcd[i].nr_vals; j++ )
    1.49 +                printf(" %10u", (unsigned int)pcd[i].vals[j]);
    1.50  
    1.51          printf("\n");
    1.52      }
     2.1 --- a/xen/common/perfc.c	Fri Mar 18 10:47:46 2005 +0000
     2.2 +++ b/xen/common/perfc.c	Fri Mar 18 11:16:56 2005 +0000
     2.3 @@ -66,12 +66,6 @@ void perfc_printall(unsigned char key)
     2.4              for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
     2.5                  sum += atomic_read(&counters[j]);
     2.6              printk("TOTAL[%10d]  ", sum);
     2.7 -            for ( j = 0; j < perfc_info[i].nr_elements; j++ )
     2.8 -            {
     2.9 -                if ( (j != 0) && ((j % 4) == 0) )
    2.10 -                    printk("\n                   ");
    2.11 -                printk("ARR%02d[%10d]  ", j, atomic_read(&counters[j]));
    2.12 -            }
    2.13              counters += j;
    2.14              break;
    2.15          }