From: "Jan Beulich" Subject: [PATCH] x86: add perf counter for pointless updates of writable pages through a hypercall Date: Thu, 12 Jun 2008 15:36:20 +0100 Message-ID: <48515084.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Signed-off-by: Jan Beulich Index: 2008-06-12/xen/arch/x86/mm.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-06-12.orig/xen/arch/x86/mm.c 2008-06-12 09:04:50.000000000 = +0200 +++ 2008-06-12/xen/arch/x86/mm.c 2008-06-12 09:08:36.000000000 = +0200 @@ -2606,6 +2606,8 @@ int do_mmu_update( if ( unlikely(!get_page_type(page, PGT_writable_page)) ) break; =20 + perfc_incr(writable_mmu_updates); + okay =3D paging_write_guest_entry(v, va, req.val, = _mfn(mfn)); =20 put_page_type(page); Index: 2008-06-12/xen/include/asm-x86/perfc_defn.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-06-12.orig/xen/include/asm-x86/perfc_defn.h 2008-06-10 = 18:00:41.000000000 +0200 +++ 2008-06-12/xen/include/asm-x86/perfc_defn.h 2008-06-12 09:08:36.0000000= 00 +0200 @@ -23,6 +23,7 @@ PERFCOUNTER(calls_to_mmuext_op, =20 PERFCOUNTER(num_mmuext_ops, "mmuext ops") PERFCOUNTER(calls_to_mmu_update, "calls to mmu_update") PERFCOUNTER(num_page_updates, "page updates") +PERFCOUNTER(writable_mmu_updates, "mmu_update-s of writable pages") PERFCOUNTER(calls_to_update_va, "calls to update_va_map") PERFCOUNTER(page_faults, "page faults") PERFCOUNTER(copy_user_faults, "copy_user faults")