WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64] Convert some stats to perfc.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Convert some stats to perfc.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Aug 2006 22:20:33 +0000
Delivery-date: Wed, 09 Aug 2006 15:24:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 3d6c1af609bfd49fc4ee89df0923334e04558058
# Parent  147144f9ec51c5963c878af8acc5bb9830b04608
[IA64] Convert some stats to perfc.

Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>
---
 xen/arch/ia64/asm-offsets.c        |    5 ++++
 xen/arch/ia64/xen/domain.c         |    2 -
 xen/arch/ia64/xen/faults.c         |    2 -
 xen/arch/ia64/xen/hypercall.c      |    4 +--
 xen/arch/ia64/xen/hyperprivop.S    |    8 +++---
 xen/arch/ia64/xen/privop_stat.c    |   46 -------------------------------------
 xen/arch/ia64/xen/vcpu.c           |   10 ++++----
 xen/include/asm-ia64/perfc_defn.h  |   25 +++++++++++++++++++-
 xen/include/asm-ia64/privop_stat.h |   18 --------------
 9 files changed, 42 insertions(+), 78 deletions(-)

diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c       Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/asm-offsets.c       Thu Aug 03 11:21:34 2006 -0600
@@ -211,4 +211,9 @@ void foo(void)
        DEFINE(IA64_KR_IO_BASE_OFFSET, offsetof (cpu_kr_ia64_t, 
_kr[IA64_KR_IO_BASE]));
        DEFINE(IA64_KR_CURRENT_STACK_OFFSET, offsetof (cpu_kr_ia64_t, 
_kr[IA64_KR_CURRENT_STACK]));
 
+#ifdef PERF_COUNTERS
+       BLANK();
+       DEFINE(RECOVER_TO_PAGE_FAULT_PERFC_OFS, offsetof (struct perfcounter, 
recover_to_page_fault));
+       DEFINE(RECOVER_TO_BREAK_FAULT_PERFC_OFS, offsetof (struct perfcounter, 
recover_to_break_fault));
+#endif
 }
diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c        Thu Aug 03 11:21:34 2006 -0600
@@ -136,7 +136,7 @@ void context_switch(struct vcpu *prev, s
     uint64_t pta;
 
     local_irq_save(spsr);
-    context_switch_count++;
+    perfc_incrc(context_switch);
 
     __ia64_save_fpu(prev->arch._thread.fph);
     __ia64_load_fpu(next->arch._thread.fph);
diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c        Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/xen/faults.c        Thu Aug 03 11:21:34 2006 -0600
@@ -170,7 +170,7 @@ handle_lazy_cover(struct vcpu *v, struct
                PSCB(v,ifs) = regs->cr_ifs;
                PSCB(v,incomplete_regframe) = 1;
                regs->cr_ifs = 0;
-               lazy_cover_count++;
+               perfc_incrc(lazy_cover);
                return(1); // retry same instruction with cr.ifs off
        }
        return(0);
diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/xen/hypercall.c     Thu Aug 03 11:21:34 2006 -0600
@@ -210,7 +210,7 @@ fw_hypercall (struct pt_regs *regs)
                if (regs->r28 == PAL_HALT_LIGHT) {
                        if (vcpu_deliverable_interrupts(v) ||
                                event_pending(v)) {
-                                       idle_when_pending++;
+                               perfc_incrc(idle_when_pending);
                                vcpu_pend_unspecified_interrupt(v);
 //printf("idle w/int#%d pending!\n",pi);
 //this shouldn't happen, but it apparently does quite a bit!  so don't
@@ -219,7 +219,7 @@ fw_hypercall (struct pt_regs *regs)
 //as deliver_pending_interrupt is called on the way out and will deliver it
                        }
                        else {
-                               pal_halt_light_count++;
+                               perfc_incrc(pal_halt_light);
                                do_sched_op_compat(SCHEDOP_yield, 0);
                        }
                        regs->r8 = 0;
diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/xen/hyperprivop.S
--- a/xen/arch/ia64/xen/hyperprivop.S   Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/xen/hyperprivop.S   Thu Aug 03 11:21:34 2006 -0600
@@ -977,8 +977,8 @@ END(fast_tlb_miss_reflect)
 
 // we get here if fast_insert fails (e.g. due to metaphysical lookup)
 ENTRY(recover_and_page_fault)
-#ifdef FAST_REFLECT_CNT
-       movl r21=recover_to_page_fault_count;;
+#ifdef PERF_COUNTERS
+       movl r21=perfcounters + RECOVER_TO_PAGE_FAULT_PERFC_OFS;;
        ld8 r22=[r21];;
        adds r22=1,r22;;
        st8 [r21]=r22;;
@@ -2009,8 +2009,8 @@ END(hyper_ptc_ga)
 
 // recovery block for hyper_itc metaphysical memory lookup
 ENTRY(recover_and_dispatch_break_fault)
-#ifdef FAST_REFLECT_CNT
-       movl r21=recover_to_break_fault_count;;
+#ifdef PERF_COUNTERS
+       movl r21=perfcounters + RECOVER_TO_BREAK_FAULT_PERFC_OFS;;
        ld8 r22=[r21];;
        adds r22=1,r22;;
        st8 [r21]=r22;;
diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/xen/privop_stat.c
--- a/xen/arch/ia64/xen/privop_stat.c   Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/xen/privop_stat.c   Thu Aug 03 11:21:34 2006 -0600
@@ -2,18 +2,6 @@
 #include <asm/vhpt.h>
 #include <xen/lib.h>
 #include <asm/uaccess.h>
-
-unsigned long dtlb_translate_count = 0;
-unsigned long tr_translate_count = 0;
-unsigned long phys_translate_count = 0;
-unsigned long vhpt_translate_count = 0;
-unsigned long fast_vhpt_translate_count = 0;
-unsigned long recover_to_page_fault_count = 0;
-unsigned long recover_to_break_fault_count = 0;
-unsigned long idle_when_pending = 0;
-unsigned long pal_halt_light_count = 0;
-unsigned long context_switch_count = 0;
-unsigned long lazy_cover_count = 0;
 
 unsigned long slow_hyperpriv_cnt[HYPERPRIVOP_MAX+1] = { 0 };
 unsigned long fast_hyperpriv_cnt[HYPERPRIVOP_MAX+1] = { 0 };
@@ -235,38 +223,6 @@ static int zero_privop_counts(char *buf)
        return s - buf;
 }
 
-static int dump_misc_stats(char *buf)
-{
-       char *s = buf;
-       s += sprintf(s,"Virtual TR translations: %ld\n",tr_translate_count);
-       s += sprintf(s,"Virtual VHPT slow translations: 
%ld\n",vhpt_translate_count);
-       s += sprintf(s,"Virtual VHPT fast translations: 
%ld\n",fast_vhpt_translate_count);
-       s += sprintf(s,"Virtual DTLB translations: %ld\n",dtlb_translate_count);
-       s += sprintf(s,"Physical translations: %ld\n",phys_translate_count);
-       s += sprintf(s,"Recoveries to page fault: 
%ld\n",recover_to_page_fault_count);
-       s += sprintf(s,"Recoveries to break fault: 
%ld\n",recover_to_break_fault_count);
-       s += sprintf(s,"Idle when pending: %ld\n",idle_when_pending);
-       s += sprintf(s,"PAL_HALT_LIGHT (no pending): 
%ld\n",pal_halt_light_count);
-       s += sprintf(s,"context switches: %ld\n",context_switch_count);
-       s += sprintf(s,"Lazy covers: %ld\n",lazy_cover_count);
-       return s - buf;
-}
-
-static void zero_misc_stats(void)
-{
-       dtlb_translate_count = 0;
-       tr_translate_count = 0;
-       phys_translate_count = 0;
-       vhpt_translate_count = 0;
-       fast_vhpt_translate_count = 0;
-       recover_to_page_fault_count = 0;
-       recover_to_break_fault_count = 0;
-       lazy_cover_count = 0;
-       pal_halt_light_count = 0;
-       idle_when_pending = 0;
-       context_switch_count = 0;
-}
-
 static const char * const hyperpriv_str[HYPERPRIVOP_MAX+1] = {
        0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i",
        "=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d",
@@ -360,7 +316,6 @@ int dump_privop_counts_to_user(char __us
        n += dump_privop_addrs(buf + n);
 #endif
        n += dump_vhpt_stats(buf + n);
-       n += dump_misc_stats(buf + n);
        if (__copy_to_user(ubuf,buf,n))
                return -1;
        return n;
@@ -381,7 +336,6 @@ int zero_privop_counts_to_user(char __us
        zero_privop_addrs();
 #endif
        zero_vhpt_stats();
-       zero_misc_stats();
        zero_reflect_counts();
        if (__copy_to_user(ubuf,buf,n))
                return -1;
diff -r 147144f9ec51 -r 3d6c1af609bf xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/arch/ia64/xen/vcpu.c  Thu Aug 03 11:21:34 2006 -0600
@@ -1500,7 +1500,7 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN
                        *pteval = (address & _PAGE_PPN_MASK) | __DIRTY_BITS |
                                  _PAGE_PL_2 | _PAGE_AR_RWX;
                        *itir = PAGE_SHIFT << 2;
-                       phys_translate_count++;
+                       perfc_incrc(phys_translate);
                        return IA64_NO_FAULT;
                }
        }
@@ -1521,7 +1521,7 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN
                if (trp != NULL) {
                        *pteval = trp->pte.val;
                        *itir = trp->itir;
-                       tr_translate_count++;
+                       perfc_incrc(tr_translate);
                        return IA64_NO_FAULT;
                }
        }
@@ -1531,7 +1531,7 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN
                if (trp != NULL) {
                        *pteval = trp->pte.val;
                        *itir = trp->itir;
-                       tr_translate_count++;
+                       perfc_incrc(tr_translate);
                        return IA64_NO_FAULT;
                }
        }
@@ -1544,7 +1544,7 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN
            && vcpu_match_tr_entry_no_p(trp,address,rid)) {
                *pteval = pte.val;
                *itir = trp->itir;
-               dtlb_translate_count++;
+               perfc_incrc(dtlb_translate);
                return IA64_USE_TLB;
        }
 
@@ -1582,7 +1582,7 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN
        /* found mapping in guest VHPT! */
        *itir = rr & RR_PS_MASK;
        *pteval = pte.val;
-       vhpt_translate_count++;
+       perfc_incrc(vhpt_translate);
        return IA64_NO_FAULT;
 }
 
diff -r 147144f9ec51 -r 3d6c1af609bf xen/include/asm-ia64/perfc_defn.h
--- a/xen/include/asm-ia64/perfc_defn.h Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/include/asm-ia64/perfc_defn.h Thu Aug 03 11:21:34 2006 -0600
@@ -1,1 +1,24 @@
-/* This file is empty.  */
+#ifndef XEN_PERFC_DEFN_H
+#define XEN_PERFC_DEFN_H
+
+PERFCOUNTER_CPU(dtlb_translate,                "dtlb hit")
+
+PERFCOUNTER_CPU(tr_translate,          "TR hit")
+
+PERFCOUNTER_CPU(vhpt_translate,                "virtual vhpt translation")
+PERFCOUNTER_CPU(fast_vhpt_translate,   "virtual vhpt fast translation")
+
+PERFCOUNTER(recover_to_page_fault,     "recoveries to page fault")
+PERFCOUNTER(recover_to_break_fault,    "recoveries to break fault")
+
+PERFCOUNTER_CPU(phys_translate,                "metaphysical translation")
+
+PERFCOUNTER_CPU(idle_when_pending,     "vcpu idle at event")
+
+PERFCOUNTER_CPU(pal_halt_light,                "calls to pal_halt_light")
+
+PERFCOUNTER_CPU(context_switch,                "context switch")
+
+PERFCOUNTER_CPU(lazy_cover,            "lazy cover")
+
+#endif
diff -r 147144f9ec51 -r 3d6c1af609bf xen/include/asm-ia64/privop_stat.h
--- a/xen/include/asm-ia64/privop_stat.h        Thu Aug 03 11:10:53 2006 -0600
+++ b/xen/include/asm-ia64/privop_stat.h        Thu Aug 03 11:21:34 2006 -0600
@@ -6,24 +6,6 @@ extern int zero_privop_counts_to_user(ch
 extern int zero_privop_counts_to_user(char *, int);
 
 #define PRIVOP_ADDR_COUNT
-
-/* vcpu_translate hit with dtlb.  */
-extern unsigned long dtlb_translate_count;
-
-/* vcpu_translate hit with tr.  */
-extern unsigned long tr_translate_count;
-
-/* vcpu_translate in metaphysical mode.  */
-extern unsigned long phys_translate_count;
-
-extern unsigned long vhpt_translate_count;
-extern unsigned long fast_vhpt_translate_count;
-extern unsigned long recover_to_page_fault_count;
-extern unsigned long recover_to_break_fault_count;
-extern unsigned long idle_when_pending;
-extern unsigned long pal_halt_light_count;
-extern unsigned long context_switch_count;
-extern unsigned long lazy_cover_count;
 
 extern unsigned long slow_hyperpriv_cnt[HYPERPRIVOP_MAX+1];
 extern unsigned long fast_hyperpriv_cnt[HYPERPRIVOP_MAX+1];

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Convert some stats to perfc., Xen patchbot-unstable <=