ia64/xen-unstable

changeset 11709:ce9816c14040

[IA64] add perfcounter to mm.c

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Mon Oct 02 21:37:39 2006 -0600 (2006-10-02)
parents 3f28ffed6fff
children 0c7e58ba4fbd
files xen/arch/ia64/xen/mm.c xen/include/asm-ia64/perfc_defn.h
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Mon Oct 02 21:34:47 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Mon Oct 02 21:37:39 2006 -0600
     1.3 @@ -1057,6 +1057,7 @@ assign_domain_page_replace(struct domain
     1.4              put_page(old_page);
     1.5          }
     1.6      }
     1.7 +    perfc_incrc(assign_domain_page_replace);
     1.8  }
     1.9  
    1.10  // caller must get_page(new_page) before
    1.11 @@ -1117,6 +1118,7 @@ assign_domain_page_cmpxchg_rel(struct do
    1.12  
    1.13      domain_page_flush(d, mpaddr, old_mfn, new_mfn);
    1.14      put_page(old_page);
    1.15 +    perfc_incrc(assign_domain_pge_cmpxchg_rel);
    1.16      return 0;
    1.17  }
    1.18  
    1.19 @@ -1189,6 +1191,7 @@ zap_domain_page_one(struct domain *d, un
    1.20          try_to_clear_PGC_allocate(d, page);
    1.21      }
    1.22      put_page(page);
    1.23 +    perfc_incrc(zap_dcomain_page_one);
    1.24  }
    1.25  
    1.26  unsigned long
    1.27 @@ -1201,6 +1204,7 @@ dom0vp_zap_physmap(struct domain *d, uns
    1.28      }
    1.29  
    1.30      zap_domain_page_one(d, gpfn << PAGE_SHIFT, INVALID_MFN);
    1.31 +    perfc_incrc(dom0vp_zap_physmap);
    1.32      return 0;
    1.33  }
    1.34  
    1.35 @@ -1246,6 +1250,7 @@ dom0vp_add_physmap(struct domain* d, uns
    1.36             get_gpfn_from_mfn(mfn) != INVALID_M2P_ENTRY);
    1.37      assign_domain_page_replace(d, gpfn << PAGE_SHIFT, mfn, flags);
    1.38      //don't update p2m table because this page belongs to rd, not d.
    1.39 +    perfc_incrc(dom0vp_add_physmap);
    1.40  out1:
    1.41      put_domain(rd);
    1.42      return error;
    1.43 @@ -1277,6 +1282,7 @@ create_grant_host_mapping(unsigned long 
    1.44             get_gpfn_from_mfn(mfn) != INVALID_M2P_ENTRY);
    1.45      assign_domain_page_replace(d, gpaddr, mfn, (flags & GNTMAP_readonly)?
    1.46                                                ASSIGN_readonly: ASSIGN_writable);
    1.47 +    perfc_incrc(create_grant_host_mapping);
    1.48      return GNTST_okay;
    1.49  }
    1.50  
    1.51 @@ -1336,6 +1342,7 @@ destroy_grant_host_mapping(unsigned long
    1.52      BUG_ON(page_get_owner(page) == d);//try_to_clear_PGC_allocate(d, page) is not needed.
    1.53      put_page(page);
    1.54  
    1.55 +    perfc_incrc(destroy_grant_host_mapping);
    1.56      return GNTST_okay;
    1.57  }
    1.58  
    1.59 @@ -1396,6 +1403,7 @@ steal_page(struct domain *d, struct page
    1.60              free_domheap_page(new);
    1.61              return -1;
    1.62          }
    1.63 +        perfc_incrc(steal_page_refcount);
    1.64      }
    1.65  
    1.66      spin_lock(&d->page_alloc_lock);
    1.67 @@ -1465,6 +1473,7 @@ steal_page(struct domain *d, struct page
    1.68      list_del(&page->list);
    1.69  
    1.70      spin_unlock(&d->page_alloc_lock);
    1.71 +    perfc_incrc(steal_page);
    1.72      return 0;
    1.73  }
    1.74  
    1.75 @@ -1482,6 +1491,8 @@ guest_physmap_add_page(struct domain *d,
    1.76      assign_domain_page_replace(d, gpfn << PAGE_SHIFT, mfn, ASSIGN_writable);
    1.77  
    1.78      //BUG_ON(mfn != ((lookup_domain_mpa(d, gpfn << PAGE_SHIFT) & _PFN_MASK) >> PAGE_SHIFT));
    1.79 +
    1.80 +    perfc_incrc(guest_physmap_add_page);
    1.81  }
    1.82  
    1.83  void
    1.84 @@ -1490,6 +1501,7 @@ guest_physmap_remove_page(struct domain 
    1.85  {
    1.86      BUG_ON(mfn == 0);//XXX
    1.87      zap_domain_page_one(d, gpfn << PAGE_SHIFT, mfn);
    1.88 +    perfc_incrc(guest_physmap_remove_page);
    1.89  }
    1.90  
    1.91  //XXX sledgehammer.
    1.92 @@ -1502,6 +1514,7 @@ domain_page_flush(struct domain* d, unsi
    1.93          shadow_mark_page_dirty(d, mpaddr >> PAGE_SHIFT);
    1.94  
    1.95      domain_flush_vtlb_all();
    1.96 +    perfc_incrc(domain_page_flush);
    1.97  }
    1.98  
    1.99  int
     2.1 --- a/xen/include/asm-ia64/perfc_defn.h	Mon Oct 02 21:34:47 2006 -0600
     2.2 +++ b/xen/include/asm-ia64/perfc_defn.h	Mon Oct 02 21:37:39 2006 -0600
     2.3 @@ -116,3 +116,17 @@ PERFCOUNTER_CPU(domain_flush_vtlb_range,
     2.4  
     2.5  // domain.c
     2.6  PERFCOUNTER_CPU(flush_vtlb_for_context_switch,  "flush_vtlb_for_context_switch")
     2.7 +
     2.8 +// mm.c
     2.9 +PERFCOUNTER_CPU(assign_domain_page_replace,     "assign_domain_page_replace")
    2.10 +PERFCOUNTER_CPU(assign_domain_pge_cmpxchg_rel,  "assign_domain_pge_cmpxchg_rel")
    2.11 +PERFCOUNTER_CPU(zap_dcomain_page_one,           "zap_dcomain_page_one")
    2.12 +PERFCOUNTER_CPU(dom0vp_zap_physmap,             "dom0vp_zap_physmap")
    2.13 +PERFCOUNTER_CPU(dom0vp_add_physmap,             "dom0vp_add_physmap")
    2.14 +PERFCOUNTER_CPU(create_grant_host_mapping,      "create_grant_host_mapping")
    2.15 +PERFCOUNTER_CPU(destroy_grant_host_mapping,     "destroy_grant_host_mapping")
    2.16 +PERFCOUNTER_CPU(steal_page_refcount,            "steal_page_refcount")
    2.17 +PERFCOUNTER_CPU(steal_page,                     "steal_page")
    2.18 +PERFCOUNTER_CPU(guest_physmap_add_page,         "guest_physmap_add_page")
    2.19 +PERFCOUNTER_CPU(guest_physmap_remove_page,      "guest_physmap_remove_page")
    2.20 +PERFCOUNTER_CPU(domain_page_flush,              "domain_page_flush")