direct-io.hg

changeset 11450:5791030e6473

[IA64] Add VTI related perfc

This patch intends to add VTI-related and fw_hypercall counters.

Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
Signed-off-by: Hiroya INAKOSHI <inakoshi.hiroya@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Sun Sep 10 14:31:54 2006 -0600 (2006-09-10)
parents d4e85f8453ba
children 3bed37b2c599
files xen/arch/ia64/vmx/mmio.c xen/arch/ia64/vmx/pal_emul.c xen/arch/ia64/vmx/vmx_interrupt.c xen/arch/ia64/vmx/vmx_phy_mode.c xen/arch/ia64/vmx/vmx_process.c xen/arch/ia64/vmx/vmx_virt.c xen/arch/ia64/xen/hypercall.c xen/include/asm-ia64/perfc_defn.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/mmio.c	Sun Sep 10 14:26:27 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/mmio.c	Sun Sep 10 14:31:54 2006 -0600
     1.3 @@ -213,6 +213,7 @@ static void mmio_access(VCPU *vcpu, u64 
     1.4      iot=__gpfn_is_io(vcpu->domain, src_pa>>PAGE_SHIFT);
     1.5      v_plat = vmx_vcpu_get_plat(vcpu);
     1.6  
     1.7 +    perfc_incra(vmx_mmio_access, iot >> 56);
     1.8      switch (iot) {
     1.9      case GPFN_PIB:
    1.10          if(!dir)
     2.1 --- a/xen/arch/ia64/vmx/pal_emul.c	Sun Sep 10 14:26:27 2006 -0600
     2.2 +++ b/xen/arch/ia64/vmx/pal_emul.c	Sun Sep 10 14:31:54 2006 -0600
     2.3 @@ -389,6 +389,7 @@ pal_emul(VCPU *vcpu) {
     2.4  
     2.5  	vcpu_get_gr_nat(vcpu,28,&gr28);  //bank1
     2.6  
     2.7 +	perfc_incrc(vmx_pal_emul);
     2.8  	switch (gr28) {
     2.9  		case PAL_CACHE_FLUSH:
    2.10  			result = pal_cache_flush(vcpu);
     3.1 --- a/xen/arch/ia64/vmx/vmx_interrupt.c	Sun Sep 10 14:26:27 2006 -0600
     3.2 +++ b/xen/arch/ia64/vmx/vmx_interrupt.c	Sun Sep 10 14:31:54 2006 -0600
     3.3 @@ -92,6 +92,7 @@ inject_guest_interruption(VCPU *vcpu, u6
     3.4      u64 viva;
     3.5      REGS *regs;
     3.6      ISR pt_isr;
     3.7 +    perfc_incra(vmx_inject_guest_interruption, vec >> 8);
     3.8      regs=vcpu_regs(vcpu);
     3.9      // clear cr.isr.ri 
    3.10      pt_isr.val = VMX(vcpu,cr_isr);
     4.1 --- a/xen/arch/ia64/vmx/vmx_phy_mode.c	Sun Sep 10 14:26:27 2006 -0600
     4.2 +++ b/xen/arch/ia64/vmx/vmx_phy_mode.c	Sun Sep 10 14:31:54 2006 -0600
     4.3 @@ -262,6 +262,7 @@ switch_mm_mode(VCPU *vcpu, IA64_PSR old_
     4.4      int act;
     4.5      REGS * regs=vcpu_regs(vcpu);
     4.6      act = mm_switch_action(old_psr, new_psr);
     4.7 +    perfc_incra(vmx_switch_mm_mode, act);
     4.8      switch (act) {
     4.9      case SW_V2P:
    4.10  //        printf("V -> P mode transition: (0x%lx -> 0x%lx)\n",
     5.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Sun Sep 10 14:26:27 2006 -0600
     5.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Sun Sep 10 14:31:54 2006 -0600
     5.3 @@ -115,6 +115,7 @@ vmx_ia64_handle_break (unsigned long ifa
     5.4      struct domain *d = current->domain;
     5.5      struct vcpu *v = current;
     5.6  
     5.7 +    perfc_incrc(vmx_ia64_handle_break);
     5.8  #ifdef CRASH_DEBUG
     5.9      if ((iim == 0 || iim == CDB_BREAK_NUM) && !user_mode(regs) &&
    5.10          IS_VMM_ADDRESS(regs->cr_iip)) {
     6.1 --- a/xen/arch/ia64/vmx/vmx_virt.c	Sun Sep 10 14:26:27 2006 -0600
     6.2 +++ b/xen/arch/ia64/vmx/vmx_virt.c	Sun Sep 10 14:31:54 2006 -0600
     6.3 @@ -1398,120 +1398,159 @@ if ( (cause == 0xff && opcode == 0x1e000
     6.4  
     6.5      switch(cause) {
     6.6      case EVENT_RSM:
     6.7 +        perfc_incrc(vmx_rsm);
     6.8          status=vmx_emul_rsm(vcpu, inst);
     6.9          break;
    6.10      case EVENT_SSM:
    6.11 +        perfc_incrc(vmx_ssm);
    6.12          status=vmx_emul_ssm(vcpu, inst);
    6.13          break;
    6.14      case EVENT_MOV_TO_PSR:
    6.15 +        perfc_incrc(vmx_mov_to_psr);
    6.16          status=vmx_emul_mov_to_psr(vcpu, inst);
    6.17          break;
    6.18      case EVENT_MOV_FROM_PSR:
    6.19 +        perfc_incrc(vmx_mov_from_psr);
    6.20          status=vmx_emul_mov_from_psr(vcpu, inst);
    6.21          break;
    6.22      case EVENT_MOV_FROM_CR:
    6.23 +        perfc_incrc(vmx_mov_from_cr);
    6.24          status=vmx_emul_mov_from_cr(vcpu, inst);
    6.25          break;
    6.26      case EVENT_MOV_TO_CR:
    6.27 +        perfc_incrc(vmx_mov_to_cr);
    6.28          status=vmx_emul_mov_to_cr(vcpu, inst);
    6.29          break;
    6.30      case EVENT_BSW_0:
    6.31 +        perfc_incrc(vmx_bsw0);
    6.32          status=vmx_emul_bsw0(vcpu, inst);
    6.33          break;
    6.34      case EVENT_BSW_1:
    6.35 +        perfc_incrc(vmx_bsw1);
    6.36          status=vmx_emul_bsw1(vcpu, inst);
    6.37          break;
    6.38      case EVENT_COVER:
    6.39 +        perfc_incrc(vmx_cover);
    6.40          status=vmx_emul_cover(vcpu, inst);
    6.41          break;
    6.42      case EVENT_RFI:
    6.43 +        perfc_incrc(vmx_rfi);
    6.44          status=vmx_emul_rfi(vcpu, inst);
    6.45          break;
    6.46      case EVENT_ITR_D:
    6.47 +        perfc_incrc(vmx_itr_d);
    6.48          status=vmx_emul_itr_d(vcpu, inst);
    6.49          break;
    6.50      case EVENT_ITR_I:
    6.51 +        perfc_incrc(vmx_itr_i);
    6.52          status=vmx_emul_itr_i(vcpu, inst);
    6.53          break;
    6.54      case EVENT_PTR_D:
    6.55 +        perfc_incrc(vmx_ptr_d);
    6.56          status=vmx_emul_ptr_d(vcpu, inst);
    6.57          break;
    6.58      case EVENT_PTR_I:
    6.59 +        perfc_incrc(vmx_ptr_i);
    6.60          status=vmx_emul_ptr_i(vcpu, inst);
    6.61          break;
    6.62      case EVENT_ITC_D:
    6.63 +        perfc_incrc(vmx_itc_d);
    6.64          status=vmx_emul_itc_d(vcpu, inst);
    6.65          break;
    6.66      case EVENT_ITC_I:
    6.67 +        perfc_incrc(vmx_itc_i);
    6.68          status=vmx_emul_itc_i(vcpu, inst);
    6.69          break;
    6.70      case EVENT_PTC_L:
    6.71 +        perfc_incrc(vmx_ptc_l);
    6.72          status=vmx_emul_ptc_l(vcpu, inst);
    6.73          break;
    6.74      case EVENT_PTC_G:
    6.75 +        perfc_incrc(vmx_ptc_g);
    6.76          status=vmx_emul_ptc_g(vcpu, inst);
    6.77          break;
    6.78      case EVENT_PTC_GA:
    6.79 +        perfc_incrc(vmx_ptc_ga);
    6.80          status=vmx_emul_ptc_ga(vcpu, inst);
    6.81          break;
    6.82      case EVENT_PTC_E:
    6.83 +        perfc_incrc(vmx_ptc_e);
    6.84          status=vmx_emul_ptc_e(vcpu, inst);
    6.85          break;
    6.86      case EVENT_MOV_TO_RR:
    6.87 +        perfc_incrc(vmx_mov_to_rr);
    6.88          status=vmx_emul_mov_to_rr(vcpu, inst);
    6.89          break;
    6.90      case EVENT_MOV_FROM_RR:
    6.91 +        perfc_incrc(vmx_mov_from_rr);
    6.92          status=vmx_emul_mov_from_rr(vcpu, inst);
    6.93          break;
    6.94      case EVENT_THASH:
    6.95 +        perfc_incrc(vmx_thash);
    6.96          status=vmx_emul_thash(vcpu, inst);
    6.97          break;
    6.98      case EVENT_TTAG:
    6.99 +        perfc_incrc(vmx_ttag);
   6.100          status=vmx_emul_ttag(vcpu, inst);
   6.101          break;
   6.102      case EVENT_TPA:
   6.103 +        perfc_incrc(vmx_tpa);
   6.104          status=vmx_emul_tpa(vcpu, inst);
   6.105          break;
   6.106      case EVENT_TAK:
   6.107 +        perfc_incrc(vmx_tak);
   6.108          status=vmx_emul_tak(vcpu, inst);
   6.109          break;
   6.110      case EVENT_MOV_TO_AR_IMM:
   6.111 +        perfc_incrc(vmx_mov_to_ar_imm);
   6.112          status=vmx_emul_mov_to_ar_imm(vcpu, inst);
   6.113          break;
   6.114      case EVENT_MOV_TO_AR:
   6.115 +        perfc_incrc(vmx_mov_to_ar_reg);
   6.116          status=vmx_emul_mov_to_ar_reg(vcpu, inst);
   6.117          break;
   6.118      case EVENT_MOV_FROM_AR:
   6.119 +        perfc_incrc(vmx_mov_from_ar_reg);
   6.120          status=vmx_emul_mov_from_ar_reg(vcpu, inst);
   6.121          break;
   6.122      case EVENT_MOV_TO_DBR:
   6.123 +        perfc_incrc(vmx_mov_to_dbr);
   6.124          status=vmx_emul_mov_to_dbr(vcpu, inst);
   6.125          break;
   6.126      case EVENT_MOV_TO_IBR:
   6.127 +        perfc_incrc(vmx_mov_to_ibr);
   6.128          status=vmx_emul_mov_to_ibr(vcpu, inst);
   6.129          break;
   6.130      case EVENT_MOV_TO_PMC:
   6.131 +        perfc_incrc(vmx_mov_to_pmc);
   6.132          status=vmx_emul_mov_to_pmc(vcpu, inst);
   6.133          break;
   6.134      case EVENT_MOV_TO_PMD:
   6.135 +        perfc_incrc(vmx_mov_to_pmd);
   6.136          status=vmx_emul_mov_to_pmd(vcpu, inst);
   6.137          break;
   6.138      case EVENT_MOV_TO_PKR:
   6.139 +        perfc_incrc(vmx_mov_to_pkr);
   6.140          status=vmx_emul_mov_to_pkr(vcpu, inst);
   6.141          break;
   6.142      case EVENT_MOV_FROM_DBR:
   6.143 +        perfc_incrc(vmx_mov_from_dbr);
   6.144          status=vmx_emul_mov_from_dbr(vcpu, inst);
   6.145          break;
   6.146      case EVENT_MOV_FROM_IBR:
   6.147 +        perfc_incrc(vmx_mov_from_ibr);
   6.148          status=vmx_emul_mov_from_ibr(vcpu, inst);
   6.149          break;
   6.150      case EVENT_MOV_FROM_PMC:
   6.151 +        perfc_incrc(vmx_mov_from_pmc);
   6.152          status=vmx_emul_mov_from_pmc(vcpu, inst);
   6.153          break;
   6.154      case EVENT_MOV_FROM_PKR:
   6.155 +        perfc_incrc(vmx_mov_from_pkr);
   6.156          status=vmx_emul_mov_from_pkr(vcpu, inst);
   6.157          break;
   6.158      case EVENT_MOV_FROM_CPUID:
   6.159 +        perfc_incrc(vmx_mov_from_cpuid);
   6.160          status=vmx_emul_mov_from_cpuid(vcpu, inst);
   6.161          break;
   6.162      case EVENT_VMSW:
     7.1 --- a/xen/arch/ia64/xen/hypercall.c	Sun Sep 10 14:26:27 2006 -0600
     7.2 +++ b/xen/arch/ia64/xen/hypercall.c	Sun Sep 10 14:31:54 2006 -0600
     7.3 @@ -211,6 +211,7 @@ fw_hypercall (struct pt_regs *regs)
     7.4  	IA64FAULT fault; 
     7.5  	unsigned long index = regs->r2 & FW_HYPERCALL_NUM_MASK_HIGH;
     7.6  
     7.7 +	perfc_incra(fw_hypercall, index >> 8);
     7.8  	switch (index) {
     7.9  	    case FW_HYPERCALL_PAL_CALL:
    7.10  		//printf("*** PAL hypercall: index=%d\n",regs->r28);
     8.1 --- a/xen/include/asm-ia64/perfc_defn.h	Sun Sep 10 14:26:27 2006 -0600
     8.2 +++ b/xen/include/asm-ia64/perfc_defn.h	Sun Sep 10 14:31:54 2006 -0600
     8.3 @@ -35,6 +35,48 @@ PERFCOUNTER_ARRAY(mov_from_cr,        "p
     8.4  
     8.5  PERFCOUNTER_ARRAY(misc_privop,        "privop misc", 64)
     8.6  
     8.7 +// privileged instructions to fall into vmx_entry
     8.8 +PERFCOUNTER_CPU(vmx_rsm,              "vmx privop rsm")
     8.9 +PERFCOUNTER_CPU(vmx_ssm,              "vmx privop ssm")
    8.10 +PERFCOUNTER_CPU(vmx_mov_to_psr,       "vmx privop mov_to_psr")
    8.11 +PERFCOUNTER_CPU(vmx_mov_from_psr,     "vmx privop mov_from_psr")
    8.12 +PERFCOUNTER_CPU(vmx_mov_from_cr,      "vmx privop mov_from_cr")
    8.13 +PERFCOUNTER_CPU(vmx_mov_to_cr,        "vmx privop mov_to_cr")
    8.14 +PERFCOUNTER_CPU(vmx_bsw0,             "vmx privop bsw0")
    8.15 +PERFCOUNTER_CPU(vmx_bsw1,             "vmx privop bsw1")
    8.16 +PERFCOUNTER_CPU(vmx_cover,            "vmx privop cover")
    8.17 +PERFCOUNTER_CPU(vmx_rfi,              "vmx privop rfi")
    8.18 +PERFCOUNTER_CPU(vmx_itr_d,            "vmx privop itr_d")
    8.19 +PERFCOUNTER_CPU(vmx_itr_i,            "vmx privop itr_i")
    8.20 +PERFCOUNTER_CPU(vmx_ptr_d,            "vmx privop ptr_d")
    8.21 +PERFCOUNTER_CPU(vmx_ptr_i,            "vmx privop ptr_i")
    8.22 +PERFCOUNTER_CPU(vmx_itc_d,            "vmx privop itc_d")
    8.23 +PERFCOUNTER_CPU(vmx_itc_i,            "vmx privop itc_i")
    8.24 +PERFCOUNTER_CPU(vmx_ptc_l,            "vmx privop ptc_l")
    8.25 +PERFCOUNTER_CPU(vmx_ptc_g,            "vmx privop ptc_g")
    8.26 +PERFCOUNTER_CPU(vmx_ptc_ga,           "vmx privop ptc_ga")
    8.27 +PERFCOUNTER_CPU(vmx_ptc_e,            "vmx privop ptc_e")
    8.28 +PERFCOUNTER_CPU(vmx_mov_to_rr,        "vmx privop mov_to_rr")
    8.29 +PERFCOUNTER_CPU(vmx_mov_from_rr,      "vmx privop mov_from_rr")
    8.30 +PERFCOUNTER_CPU(vmx_thash,            "vmx privop thash")
    8.31 +PERFCOUNTER_CPU(vmx_ttag,             "vmx privop ttag")
    8.32 +PERFCOUNTER_CPU(vmx_tpa,              "vmx privop tpa")
    8.33 +PERFCOUNTER_CPU(vmx_tak,              "vmx privop tak")
    8.34 +PERFCOUNTER_CPU(vmx_mov_to_ar_imm,    "vmx privop mov_to_ar_imm")
    8.35 +PERFCOUNTER_CPU(vmx_mov_to_ar_reg,    "vmx privop mov_to_ar_reg")
    8.36 +PERFCOUNTER_CPU(vmx_mov_from_ar_reg,  "vmx privop mov_from_ar_reg")
    8.37 +PERFCOUNTER_CPU(vmx_mov_to_dbr,       "vmx privop mov_to_dbr")
    8.38 +PERFCOUNTER_CPU(vmx_mov_to_ibr,       "vmx privop mov_to_ibr")
    8.39 +PERFCOUNTER_CPU(vmx_mov_to_pmc,       "vmx privop mov_to_pmc")
    8.40 +PERFCOUNTER_CPU(vmx_mov_to_pmd,       "vmx privop mov_to_pmd")
    8.41 +PERFCOUNTER_CPU(vmx_mov_to_pkr,       "vmx privop mov_to_pkr")
    8.42 +PERFCOUNTER_CPU(vmx_mov_from_dbr,     "vmx privop mov_from_dbr")
    8.43 +PERFCOUNTER_CPU(vmx_mov_from_ibr,     "vmx privop mov_from_ibr")
    8.44 +PERFCOUNTER_CPU(vmx_mov_from_pmc,     "vmx privop mov_from_pmc")
    8.45 +PERFCOUNTER_CPU(vmx_mov_from_pkr,     "vmx privop mov_from_pkr")
    8.46 +PERFCOUNTER_CPU(vmx_mov_from_cpuid,   "vmx privop mov_from_cpuid")
    8.47 +
    8.48 +
    8.49  PERFCOUNTER_ARRAY(slow_hyperprivop,   "slow hyperprivops", HYPERPRIVOP_MAX + 1)
    8.50  PERFCOUNTER_ARRAY(fast_hyperprivop,   "fast hyperprivops", HYPERPRIVOP_MAX + 1)
    8.51  
    8.52 @@ -44,6 +86,14 @@ PERFCOUNTER_ARRAY(fast_reflect,       "f
    8.53  PERFSTATUS(vhpt_nbr_entries,          "nbr of entries per VHPT")
    8.54  PERFSTATUS_CPU(vhpt_valid_entries,    "nbr of valid entries in VHPT")
    8.55  
    8.56 +PERFCOUNTER_ARRAY(vmx_mmio_access,    "vmx_mmio_access", 8)
    8.57 +PERFCOUNTER_CPU(vmx_pal_emul,         "vmx_pal_emul")
    8.58 +PERFCOUNTER_ARRAY(vmx_switch_mm_mode, "vmx_switch_mm_mode", 8)
    8.59 +PERFCOUNTER_CPU(vmx_ia64_handle_break,"vmx_ia64_handle_break")
    8.60 +PERFCOUNTER_ARRAY(vmx_inject_guest_interruption,
    8.61 +                                      "vmx_inject_guest_interruption", 0x80)
    8.62 +PERFCOUNTER_ARRAY(fw_hypercall,       "fw_hypercall", 0x20)
    8.63 +
    8.64  #ifdef CONFIG_PRIVOP_ADDRS
    8.65  #ifndef PERFPRIVOPADDR
    8.66  #define PERFPRIVOPADDR(name) \