aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormafetter@fleming.research <mafetter@fleming.research>2005-05-10 12:41:09 +0000
committermafetter@fleming.research <mafetter@fleming.research>2005-05-10 12:41:09 +0000
commit46d5b271ad939669420098821b4b38e5b8d858b6 (patch)
tree0a8ec27f1aa17c8168aa0038711fcdf2121aed57
parentde17f86b3ba78f3e69a88501de448fbfbbaeedf1 (diff)
downloadxen-46d5b271ad939669420098821b4b38e5b8d858b6.tar.gz
xen-46d5b271ad939669420098821b4b38e5b8d858b6.tar.bz2
xen-46d5b271ad939669420098821b4b38e5b8d858b6.zip
bitkeeper revision 1.1389.5.49 (4280abe5EW2fJtuPr5_E283AlKrziQ)
Added back the printing of perfc arrays & histograms, under compile-time control in xen/Rules.mk
-rw-r--r--xen/Rules.mk4
-rw-r--r--xen/common/perfc.c8
-rw-r--r--xen/include/xen/perfc.h4
3 files changed, 16 insertions, 0 deletions
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 1fb12e8479..1db12a3d0d 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -2,6 +2,7 @@
verbose ?= n
debug ?= n
perfc ?= n
+perfc_arrays?= n
trace ?= n
optimize ?= y
domu_debug ?= n
@@ -54,6 +55,9 @@ endif
ifeq ($(perfc),y)
CFLAGS += -DPERF_COUNTERS
+ifeq ($(perfc_arrays),y)
+CFLAGS += -DPERF_ARRAYS
+endif
endif
ifeq ($(trace),y)
diff --git a/xen/common/perfc.c b/xen/common/perfc.c
index f98910c91c..157d49ffc8 100644
--- a/xen/common/perfc.c
+++ b/xen/common/perfc.c
@@ -67,6 +67,14 @@ void perfc_printall(unsigned char key)
for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
sum += atomic_read(&counters[j]);
printk("TOTAL[%10d] ", sum);
+#ifdef PERF_ARRAYS
+ 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]));
+ }
+#endif
counters += j;
break;
}
diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h
index 6d758497b1..48c7e90fb4 100644
--- a/xen/include/xen/perfc.h
+++ b/xen/include/xen/perfc.h
@@ -87,6 +87,7 @@ extern struct perfcounter perfcounters;
* Histogram: special treatment for 0 and 1 count. After that equally spaced
* with last bucket taking the rest.
*/
+#ifdef PERFC_ARRAYS
#define perfc_incr_histo(_x,_v,_n) \
do { \
if ( (_v) == 0 ) \
@@ -99,6 +100,9 @@ extern struct perfcounter perfcounters;
else \
perfc_incra(_x, PERFC_MAX_ ## _n - 1); \
} while ( 0 )
+#else
+#define perfc_incr_histo(_x,_v,_n) ((void)0)
+#endif
#else /* PERF_COUNTERS */