# HG changeset patch # User gingold@virtu10 # Node ID 6c4b7669876b707b5eccf2ad99be6681f5b52366 # Parent 6286aede6482ff468795ca9d9c58c94fae2dd758 Provides hooks for perfc print/reset/gather. These arch-neutral hooks allow architectures to report hardware counters. Signed-off-by: Tristan Gingold diff -r 6286aede6482 -r 6c4b7669876b xen/common/perfc.c --- a/xen/common/perfc.c Fri Aug 04 11:32:16 2006 +0200 +++ b/xen/common/perfc.c Fri Aug 04 11:51:09 2006 +0200 @@ -8,6 +8,7 @@ #include #include #include +#include #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]; @@ -180,6 +177,9 @@ static int perfc_copy_info(XEN_GUEST_HAN } 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 -r 6286aede6482 -r 6c4b7669876b xen/include/asm-ia64/perfc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xen/include/asm-ia64/perfc.h Fri Aug 04 11:51:09 2006 +0200 @@ -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 -r 6286aede6482 -r 6c4b7669876b xen/include/asm-powerpc/perfc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xen/include/asm-powerpc/perfc.h Fri Aug 04 11:51:09 2006 +0200 @@ -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 -r 6286aede6482 -r 6c4b7669876b xen/include/asm-x86/perfc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xen/include/asm-x86/perfc.h Fri Aug 04 11:51:09 2006 +0200 @@ -0,0 +1,23 @@ +#ifndef __ASM_PERFC_H__ +#define __ASM_PERFC_H__ +#include + +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