debuggers.hg
changeset 10992:6289234304f1
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>
These arch-neutral hooks allow architectures to report hardware counters.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Mon Aug 07 15:55:39 2006 +0100 (2006-08-07) |
parents | 7924b6bd728a |
children | ababeabf87c5 |
files | xen/common/perfc.c xen/include/asm-ia64/perfc.h xen/include/asm-powerpc/perfc.h xen/include/asm-x86/perfc.h |
line diff
1.1 --- a/xen/common/perfc.c Mon Aug 07 15:53:06 2006 +0100 1.2 +++ b/xen/common/perfc.c Mon Aug 07 15:55:39 2006 +0100 1.3 @@ -8,6 +8,7 @@ 1.4 #include <xen/mm.h> 1.5 #include <xen/guest_access.h> 1.6 #include <public/dom0_ops.h> 1.7 +#include <asm/perfc.h> 1.8 1.9 #undef PERFCOUNTER 1.10 #undef PERFCOUNTER_CPU 1.11 @@ -89,9 +90,7 @@ void perfc_printall(unsigned char key) 1.12 printk("\n"); 1.13 } 1.14 1.15 -#ifdef PERF_ARRAYS 1.16 - ptwr_eip_stat_print(); 1.17 -#endif 1.18 + arch_perfc_printall(); 1.19 } 1.20 1.21 void perfc_reset(unsigned char key) 1.22 @@ -130,9 +129,7 @@ void perfc_reset(unsigned char key) 1.23 } 1.24 } 1.25 1.26 -#ifdef PERF_ARRAYS 1.27 - ptwr_eip_stat_reset(); 1.28 -#endif 1.29 + arch_perfc_reset (); 1.30 } 1.31 1.32 static dom0_perfc_desc_t perfc_d[NR_PERFCTRS]; 1.33 @@ -181,6 +178,9 @@ static int perfc_copy_info(XEN_GUEST_HAN 1.34 if (perfc_vals == NULL) 1.35 return -ENOMEM; 1.36 1.37 + /* Architecture may fill counters from hardware. */ 1.38 + arch_perfc_gather(); 1.39 + 1.40 /* We gather the counts together every time. */ 1.41 for ( i = 0; i < NR_PERFCTRS; i++ ) 1.42 {
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/xen/include/asm-ia64/perfc.h Mon Aug 07 15:55:39 2006 +0100 2.3 @@ -0,0 +1,16 @@ 2.4 +#ifndef __ASM_PERFC_H__ 2.5 +#define __ASM_PERFC_H__ 2.6 + 2.7 +static inline void arch_perfc_printall (void) 2.8 +{ 2.9 +} 2.10 + 2.11 +static inline void arch_perfc_reset (void) 2.12 +{ 2.13 +} 2.14 + 2.15 +static inline void arch_perfc_gather (void) 2.16 +{ 2.17 +} 2.18 + 2.19 +#endif
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/xen/include/asm-powerpc/perfc.h Mon Aug 07 15:55:39 2006 +0100 3.3 @@ -0,0 +1,16 @@ 3.4 +#ifndef __ASM_PERFC_H__ 3.5 +#define __ASM_PERFC_H__ 3.6 + 3.7 +static inline void arch_perfc_printall (void) 3.8 +{ 3.9 +} 3.10 + 3.11 +static inline void arch_perfc_reset (void) 3.12 +{ 3.13 +} 3.14 + 3.15 +static inline void arch_perfc_gather (void) 3.16 +{ 3.17 +} 3.18 + 3.19 +#endif
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/xen/include/asm-x86/perfc.h Mon Aug 07 15:55:39 2006 +0100 4.3 @@ -0,0 +1,23 @@ 4.4 +#ifndef __ASM_PERFC_H__ 4.5 +#define __ASM_PERFC_H__ 4.6 +#include <asm/mm.h> 4.7 + 4.8 +static inline void arch_perfc_printall (void) 4.9 +{ 4.10 +#ifdef PERF_ARRAYS 4.11 + ptwr_eip_stat_print(); 4.12 +#endif 4.13 +} 4.14 + 4.15 +static inline void arch_perfc_reset (void) 4.16 +{ 4.17 +#ifdef PERF_ARRAYS 4.18 + ptwr_eip_stat_reset(); 4.19 +#endif 4.20 +} 4.21 + 4.22 +static inline void arch_perfc_gather (void) 4.23 +{ 4.24 +} 4.25 + 4.26 +#endif