ia64/xen-unstable

changeset 3933:b95a79b0f21a

bitkeeper revision 1.1238 (421f5ff99YUDAfj5D9rbZseED1YYVA)

added performance counters for hypercalls and exceptions

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author rneugeba@wyvis.research.intel-research.net
date Fri Feb 25 17:27:21 2005 +0000 (2005-02-25)
parents b57a97bb65bd
children a5931595eca4
files xen/arch/x86/x86_32/asm-offsets.c xen/arch/x86/x86_32/entry.S xen/common/perfc.c xen/include/xen/perfc_defn.h
line diff
     1.1 --- a/xen/arch/x86/x86_32/asm-offsets.c	Tue Feb 22 18:51:59 2005 +0000
     1.2 +++ b/xen/arch/x86/x86_32/asm-offsets.c	Fri Feb 25 17:27:21 2005 +0000
     1.3 @@ -68,4 +68,7 @@ void __dummy__(void)
     1.4      BLANK();
     1.5  
     1.6      DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
     1.7 +
     1.8 +    OFFSET(PERFC_hypercalls, struct perfcounter_t, hypercalls);
     1.9 +    OFFSET(PERFC_exceptions, struct perfcounter_t, exceptions);
    1.10  }
     2.1 --- a/xen/arch/x86/x86_32/entry.S	Tue Feb 22 18:51:59 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_32/entry.S	Fri Feb 25 17:27:21 2005 +0000
     2.3 @@ -60,7 +60,7 @@
     2.4  #include <asm/apicdef.h>
     2.5  #include <asm/page.h>
     2.6  #include <public/xen.h>
     2.7 -
     2.8 +        
     2.9  #define GET_CURRENT(reg)         \
    2.10          movl $STACK_SIZE-4, reg; \
    2.11          orl  %esp, reg;          \
    2.12 @@ -278,8 +278,11 @@ ENTRY(hypercall)
    2.13          subl $4,%esp
    2.14  	SAVE_ALL(b)
    2.15          sti
    2.16 +#ifdef PERF_COUNTERS
    2.17 +        lock incl SYMBOL_NAME(perfcounters)+PERFC_hypercalls(,%eax,4)
    2.18 +#endif
    2.19          GET_CURRENT(%ebx)
    2.20 -	andl $(NR_hypercalls-1),%eax
    2.21 +        andl $(NR_hypercalls-1),%eax
    2.22  	call *SYMBOL_NAME(hypercall_table)(,%eax,4)
    2.23          movl %eax,XREGS_eax(%esp)       # save the return value
    2.24  
    2.25 @@ -466,6 +469,9 @@ 1:      sti                             
    2.26          movw  XREGS_entry_vector(%esp),%ax
    2.27          movl  %esp,%edx
    2.28  	pushl %edx			# push the xen_regs pointer
    2.29 +#ifdef PERF_COUNTERS
    2.30 +        lock incl SYMBOL_NAME(perfcounters)+PERFC_exceptions(,%eax,4)
    2.31 +#endif        
    2.32  	GET_CURRENT(%ebx)
    2.33  	call  *SYMBOL_NAME(exception_table)(,%eax,4)
    2.34          addl  $4,%esp
     3.1 --- a/xen/common/perfc.c	Tue Feb 22 18:51:59 2005 +0000
     3.2 +++ b/xen/common/perfc.c	Fri Feb 25 17:27:21 2005 +0000
     3.3 @@ -66,7 +66,7 @@ void perfc_printall(unsigned char key)
     3.4          case TYPE_S_ARRAY:
     3.5              for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
     3.6                  sum += atomic_read(&counters[j]);
     3.7 -            printk("TOTAL[%10d]\n ", sum);
     3.8 +            printk("TOTAL[%10d]  ", sum);
     3.9              for ( j = 0; j < perfc_info[i].nr_elements; j++ )
    3.10              {
    3.11                  printk("A%02d[%10d]  ", j, atomic_read(&counters[j]));
     4.1 --- a/xen/include/xen/perfc_defn.h	Tue Feb 22 18:51:59 2005 +0000
     4.2 +++ b/xen/include/xen/perfc_defn.h	Fri Feb 25 17:27:21 2005 +0000
     4.3 @@ -41,6 +41,8 @@ PERFCOUNTER_CPU( check_all_pagetables, "
     4.4  PERFCOUNTER_ARRAY( wpt_updates, "writable pt updates", PERFC_MAX_PT_UPDATES )
     4.5  PERFCOUNTER_ARRAY( bpt_updates, "batched pt updates", PERFC_MAX_PT_UPDATES )
     4.6  
     4.7 +PERFCOUNTER_ARRAY( hypercalls, "hypercalls", NR_hypercalls )
     4.8 +PERFCOUNTER_ARRAY( exceptions, "exceptions", 32 ) /* XXX constant */
     4.9  
    4.10  #define VMX_PERF_EXIT_REASON_SIZE 37
    4.11  #define VMX_PERF_VECTOR_SIZE 0x20