KVM: PPC: Move pte invalidate debug code to tracepoint
authorAlexander Graf <agraf@suse.de>
Mon, 2 Aug 2010 10:55:19 +0000 (12:55 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:52:03 +0000 (10:52 +0200)
This patch moves the SPTE flush debug printk over to tracepoints.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_mmu_hpte.c
arch/powerpc/kvm/trace.h

index ac94bd992564b179b6ae6a42cabdab689a081ba0..3397152a2b26a68007e0262537f1acd5ddcfa44c 100644 (file)
@@ -104,8 +104,7 @@ static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
        if (hlist_unhashed(&pte->list_pte))
                return;
 
-       dprintk_mmu("KVM: Flushing SPT: 0x%lx (0x%llx) -> 0x%llx\n",
-                   pte->pte.eaddr, pte->pte.vpage, pte->host_va);
+       trace_kvm_book3s_mmu_invalidate(pte);
 
        /* Different for 32 and 64 bit */
        kvmppc_mmu_invalidate_pte(vcpu, pte);
index 68a84442d799e3286eead1da4f2dde2cd4ceece8..06ad93e40648b9874d4dbcb8c54836f387713053 100644 (file)
@@ -210,6 +210,35 @@ TRACE_EVENT(kvm_book3s_mmu_map,
                  __entry->vpage, __entry->raddr, __entry->flags)
 );
 
+TRACE_EVENT(kvm_book3s_mmu_invalidate,
+       TP_PROTO(struct hpte_cache *pte),
+       TP_ARGS(pte),
+
+       TP_STRUCT__entry(
+               __field(        u64,            host_va         )
+               __field(        u64,            pfn             )
+               __field(        ulong,          eaddr           )
+               __field(        u64,            vpage           )
+               __field(        ulong,          raddr           )
+               __field(        int,            flags           )
+       ),
+
+       TP_fast_assign(
+               __entry->host_va        = pte->host_va;
+               __entry->pfn            = pte->pfn;
+               __entry->eaddr          = pte->pte.eaddr;
+               __entry->vpage          = pte->pte.vpage;
+               __entry->raddr          = pte->pte.raddr;
+               __entry->flags          = (pte->pte.may_read ? 0x4 : 0) |
+                                         (pte->pte.may_write ? 0x2 : 0) |
+                                         (pte->pte.may_execute ? 0x1 : 0);
+       ),
+
+       TP_printk("Flush: hva=%llx pfn=%llx ea=%lx vp=%llx ra=%lx [%x]",
+                 __entry->host_va, __entry->pfn, __entry->eaddr,
+                 __entry->vpage, __entry->raddr, __entry->flags)
+);
+
 #endif /* CONFIG_PPC_BOOK3S */
 
 #endif /* _TRACE_KVM_H */