aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-08-07 15:55:39 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-08-07 15:55:39 +0100
commitcea4bbec3f9ba683f94e0f25948f1dd1bbfa8454 (patch)
treed1d40b670580ba508d57758eaa8dcf58057c42e8
parenta6e8b7effa20241c47ecd5c5fad549ac64d903a5 (diff)
downloadxen-cea4bbec3f9ba683f94e0f25948f1dd1bbfa8454.tar.gz
xen-cea4bbec3f9ba683f94e0f25948f1dd1bbfa8454.tar.bz2
xen-cea4bbec3f9ba683f94e0f25948f1dd1bbfa8454.zip
Provides hooks for perfc print/reset/gather.
These arch-neutral hooks allow architectures to report hardware counters. Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
-rw-r--r--xen/common/perfc.c12
-rw-r--r--xen/include/asm-ia64/perfc.h16
-rw-r--r--xen/include/asm-powerpc/perfc.h16
-rw-r--r--xen/include/asm-x86/perfc.h23
4 files changed, 61 insertions, 6 deletions
diff --git a/xen/common/perfc.c b/xen/common/perfc.c
index e2ba33383e..4eb696a594 100644
--- a/xen/common/perfc.c
+++ b/xen/common/perfc.c
@@ -8,6 +8,7 @@
#include <xen/mm.h>
#include <xen/guest_access.h>
#include <public/dom0_ops.h>
+#include <asm/perfc.h>
#undef PERFCOUNTER
#undef PERFCOUNTER_CPU
@@ -89,9 +90,7 @@ void perfc_printall(unsigned char key)
printk("\n");
}
-#ifdef PERF_ARRAYS
- ptwr_eip_stat_print();
-#endif
+ arch_perfc_printall();
}
void perfc_reset(unsigned char key)
@@ -130,9 +129,7 @@ void perfc_reset(unsigned char key)
}
}
-#ifdef PERF_ARRAYS
- ptwr_eip_stat_reset();
-#endif
+ arch_perfc_reset ();
}
static dom0_perfc_desc_t perfc_d[NR_PERFCTRS];
@@ -181,6 +178,9 @@ static int perfc_copy_info(XEN_GUEST_HANDLE(dom0_perfc_desc_t) desc,
if (perfc_vals == NULL)
return -ENOMEM;
+ /* Architecture may fill counters from hardware. */
+ arch_perfc_gather();
+
/* We gather the counts together every time. */
for ( i = 0; i < NR_PERFCTRS; i++ )
{
diff --git a/xen/include/asm-ia64/perfc.h b/xen/include/asm-ia64/perfc.h
new file mode 100644
index 0000000000..37a0ac3bc5
--- /dev/null
+++ b/xen/include/asm-ia64/perfc.h
@@ -0,0 +1,16 @@
+#ifndef __ASM_PERFC_H__
+#define __ASM_PERFC_H__
+
+static inline void arch_perfc_printall (void)
+{
+}
+
+static inline void arch_perfc_reset (void)
+{
+}
+
+static inline void arch_perfc_gather (void)
+{
+}
+
+#endif
diff --git a/xen/include/asm-powerpc/perfc.h b/xen/include/asm-powerpc/perfc.h
new file mode 100644
index 0000000000..37a0ac3bc5
--- /dev/null
+++ b/xen/include/asm-powerpc/perfc.h
@@ -0,0 +1,16 @@
+#ifndef __ASM_PERFC_H__
+#define __ASM_PERFC_H__
+
+static inline void arch_perfc_printall (void)
+{
+}
+
+static inline void arch_perfc_reset (void)
+{
+}
+
+static inline void arch_perfc_gather (void)
+{
+}
+
+#endif
diff --git a/xen/include/asm-x86/perfc.h b/xen/include/asm-x86/perfc.h
new file mode 100644
index 0000000000..1999bd0dbf
--- /dev/null
+++ b/xen/include/asm-x86/perfc.h
@@ -0,0 +1,23 @@
+#ifndef __ASM_PERFC_H__
+#define __ASM_PERFC_H__
+#include <asm/mm.h>
+
+static inline void arch_perfc_printall (void)
+{
+#ifdef PERF_ARRAYS
+ ptwr_eip_stat_print();
+#endif
+}
+
+static inline void arch_perfc_reset (void)
+{
+#ifdef PERF_ARRAYS
+ ptwr_eip_stat_reset();
+#endif
+}
+
+static inline void arch_perfc_gather (void)
+{
+}
+
+#endif