diff options
author | Alexander Graf <agraf@suse.de> | 2010-08-02 05:38:54 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:01 -0400 |
commit | 82fdee7bce546c3ce38dcf0db6096eea73dbe7bd (patch) | |
tree | 965c8dc11d6912fa139214567353d73413094f0c /arch/powerpc | |
parent | bed1ed9860d3744cc6488831fa5672d5c7aff4be (diff) |
KVM: PPC: Move book3s_64 mmu map debug print to trace point
This patch moves Book3s MMU debugging over to tracepoints.
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_host.c | 13 | ||||
-rw-r--r-- | arch/powerpc/kvm/trace.h | 34 |
2 files changed, 36 insertions, 11 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index 672b1495f265..aa516ad81de7 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c | |||
@@ -28,19 +28,13 @@ | |||
28 | #include <asm/machdep.h> | 28 | #include <asm/machdep.h> |
29 | #include <asm/mmu_context.h> | 29 | #include <asm/mmu_context.h> |
30 | #include <asm/hw_irq.h> | 30 | #include <asm/hw_irq.h> |
31 | #include "trace.h" | ||
31 | 32 | ||
32 | #define PTE_SIZE 12 | 33 | #define PTE_SIZE 12 |
33 | #define VSID_ALL 0 | 34 | #define VSID_ALL 0 |
34 | 35 | ||
35 | /* #define DEBUG_MMU */ | ||
36 | /* #define DEBUG_SLB */ | 36 | /* #define DEBUG_SLB */ |
37 | 37 | ||
38 | #ifdef DEBUG_MMU | ||
39 | #define dprintk_mmu(a, ...) printk(KERN_INFO a, __VA_ARGS__) | ||
40 | #else | ||
41 | #define dprintk_mmu(a, ...) do { } while(0) | ||
42 | #endif | ||
43 | |||
44 | #ifdef DEBUG_SLB | 38 | #ifdef DEBUG_SLB |
45 | #define dprintk_slb(a, ...) printk(KERN_INFO a, __VA_ARGS__) | 39 | #define dprintk_slb(a, ...) printk(KERN_INFO a, __VA_ARGS__) |
46 | #else | 40 | #else |
@@ -156,10 +150,7 @@ map_again: | |||
156 | } else { | 150 | } else { |
157 | struct hpte_cache *pte = kvmppc_mmu_hpte_cache_next(vcpu); | 151 | struct hpte_cache *pte = kvmppc_mmu_hpte_cache_next(vcpu); |
158 | 152 | ||
159 | dprintk_mmu("KVM: %c%c Map 0x%lx: [%lx] 0x%lx (0x%llx) -> %lx\n", | 153 | trace_kvm_book3s_64_mmu_map(rflags, hpteg, va, hpaddr, orig_pte); |
160 | ((rflags & HPTE_R_PP) == 3) ? '-' : 'w', | ||
161 | (rflags & HPTE_R_N) ? '-' : 'x', | ||
162 | orig_pte->eaddr, hpteg, va, orig_pte->vpage, hpaddr); | ||
163 | 154 | ||
164 | /* The ppc_md code may give us a secondary entry even though we | 155 | /* The ppc_md code may give us a secondary entry even though we |
165 | asked for a primary. Fix up. */ | 156 | asked for a primary. Fix up. */ |
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h index b5e9d81a1ea2..8ed6f1c7c86e 100644 --- a/arch/powerpc/kvm/trace.h +++ b/arch/powerpc/kvm/trace.h | |||
@@ -147,6 +147,40 @@ TRACE_EVENT(kvm_book3s_reenter, | |||
147 | TP_printk("reentry r=%d | pc=0x%lx", __entry->r, __entry->pc) | 147 | TP_printk("reentry r=%d | pc=0x%lx", __entry->r, __entry->pc) |
148 | ); | 148 | ); |
149 | 149 | ||
150 | #ifdef CONFIG_PPC_BOOK3S_64 | ||
151 | |||
152 | TRACE_EVENT(kvm_book3s_64_mmu_map, | ||
153 | TP_PROTO(int rflags, ulong hpteg, ulong va, pfn_t hpaddr, | ||
154 | struct kvmppc_pte *orig_pte), | ||
155 | TP_ARGS(rflags, hpteg, va, hpaddr, orig_pte), | ||
156 | |||
157 | TP_STRUCT__entry( | ||
158 | __field( unsigned char, flag_w ) | ||
159 | __field( unsigned char, flag_x ) | ||
160 | __field( unsigned long, eaddr ) | ||
161 | __field( unsigned long, hpteg ) | ||
162 | __field( unsigned long, va ) | ||
163 | __field( unsigned long long, vpage ) | ||
164 | __field( unsigned long, hpaddr ) | ||
165 | ), | ||
166 | |||
167 | TP_fast_assign( | ||
168 | __entry->flag_w = ((rflags & HPTE_R_PP) == 3) ? '-' : 'w'; | ||
169 | __entry->flag_x = (rflags & HPTE_R_N) ? '-' : 'x'; | ||
170 | __entry->eaddr = orig_pte->eaddr; | ||
171 | __entry->hpteg = hpteg; | ||
172 | __entry->va = va; | ||
173 | __entry->vpage = orig_pte->vpage; | ||
174 | __entry->hpaddr = hpaddr; | ||
175 | ), | ||
176 | |||
177 | TP_printk("KVM: %c%c Map 0x%lx: [%lx] 0x%lx (0x%llx) -> %lx", | ||
178 | __entry->flag_w, __entry->flag_x, __entry->eaddr, | ||
179 | __entry->hpteg, __entry->va, __entry->vpage, __entry->hpaddr) | ||
180 | ); | ||
181 | |||
182 | #endif /* CONFIG_PPC_BOOK3S_64 */ | ||
183 | |||
150 | #endif /* CONFIG_PPC_BOOK3S */ | 184 | #endif /* CONFIG_PPC_BOOK3S */ |
151 | 185 | ||
152 | #endif /* _TRACE_KVM_H */ | 186 | #endif /* _TRACE_KVM_H */ |