diff options
author | Alexander Graf <agraf@suse.de> | 2010-08-02 06:51:07 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:02 -0400 |
commit | 4c4eea7769d0099ea09f9bdb7aed1cc61d57c9d6 (patch) | |
tree | 4a03091f6c7b9585859c8ad21ffedbf2b981c705 /arch/powerpc/kvm | |
parent | 82fdee7bce546c3ce38dcf0db6096eea73dbe7bd (diff) |
KVM: PPC: Add tracepoint for generic mmu map
This patch moves the generic mmu map debugging over to tracepoints.
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s_mmu_hpte.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kvm/trace.h | 29 |
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c index 02c64ab99c97..ac94bd992564 100644 --- a/arch/powerpc/kvm/book3s_mmu_hpte.c +++ b/arch/powerpc/kvm/book3s_mmu_hpte.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kvm_host.h> | 21 | #include <linux/kvm_host.h> |
22 | #include <linux/hash.h> | 22 | #include <linux/hash.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include "trace.h" | ||
24 | 25 | ||
25 | #include <asm/kvm_ppc.h> | 26 | #include <asm/kvm_ppc.h> |
26 | #include <asm/kvm_book3s.h> | 27 | #include <asm/kvm_book3s.h> |
@@ -66,6 +67,8 @@ void kvmppc_mmu_hpte_cache_map(struct kvm_vcpu *vcpu, struct hpte_cache *pte) | |||
66 | { | 67 | { |
67 | u64 index; | 68 | u64 index; |
68 | 69 | ||
70 | trace_kvm_book3s_mmu_map(pte); | ||
71 | |||
69 | spin_lock(&vcpu->arch.mmu_lock); | 72 | spin_lock(&vcpu->arch.mmu_lock); |
70 | 73 | ||
71 | /* Add to ePTE list */ | 74 | /* Add to ePTE list */ |
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h index 8ed6f1c7c86e..68a84442d799 100644 --- a/arch/powerpc/kvm/trace.h +++ b/arch/powerpc/kvm/trace.h | |||
@@ -181,6 +181,35 @@ TRACE_EVENT(kvm_book3s_64_mmu_map, | |||
181 | 181 | ||
182 | #endif /* CONFIG_PPC_BOOK3S_64 */ | 182 | #endif /* CONFIG_PPC_BOOK3S_64 */ |
183 | 183 | ||
184 | TRACE_EVENT(kvm_book3s_mmu_map, | ||
185 | TP_PROTO(struct hpte_cache *pte), | ||
186 | TP_ARGS(pte), | ||
187 | |||
188 | TP_STRUCT__entry( | ||
189 | __field( u64, host_va ) | ||
190 | __field( u64, pfn ) | ||
191 | __field( ulong, eaddr ) | ||
192 | __field( u64, vpage ) | ||
193 | __field( ulong, raddr ) | ||
194 | __field( int, flags ) | ||
195 | ), | ||
196 | |||
197 | TP_fast_assign( | ||
198 | __entry->host_va = pte->host_va; | ||
199 | __entry->pfn = pte->pfn; | ||
200 | __entry->eaddr = pte->pte.eaddr; | ||
201 | __entry->vpage = pte->pte.vpage; | ||
202 | __entry->raddr = pte->pte.raddr; | ||
203 | __entry->flags = (pte->pte.may_read ? 0x4 : 0) | | ||
204 | (pte->pte.may_write ? 0x2 : 0) | | ||
205 | (pte->pte.may_execute ? 0x1 : 0); | ||
206 | ), | ||
207 | |||
208 | TP_printk("Map: hva=%llx pfn=%llx ea=%lx vp=%llx ra=%lx [%x]", | ||
209 | __entry->host_va, __entry->pfn, __entry->eaddr, | ||
210 | __entry->vpage, __entry->raddr, __entry->flags) | ||
211 | ); | ||
212 | |||
184 | #endif /* CONFIG_PPC_BOOK3S */ | 213 | #endif /* CONFIG_PPC_BOOK3S */ |
185 | 214 | ||
186 | #endif /* _TRACE_KVM_H */ | 215 | #endif /* _TRACE_KVM_H */ |