diff options
author | Alexander Graf <agraf@suse.de> | 2010-08-02 07:40:30 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:04 -0400 |
commit | c60b4cf70127941e2f944a7971a7f6b3ecb367ac (patch) | |
tree | 1cd31df67b8bad110ad9c3c6bafb26840921ff92 /arch/powerpc/kvm | |
parent | c22c31963b4b0c23250e8f520a76427b3986b73b (diff) |
KVM: PPC: Add tracepoints for generic spte flushes
The different ways of flusing shadow ptes have their own debug prints which use
stupid old printk.
Let's move them to tracepoints, making them easier available, faster and
possible to activate on demand
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s_mmu_hpte.c | 18 | ||||
-rw-r--r-- | arch/powerpc/kvm/trace.h | 23 |
2 files changed, 26 insertions, 15 deletions
diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c index 3397152a2b26..bd6a7676d0c8 100644 --- a/arch/powerpc/kvm/book3s_mmu_hpte.c +++ b/arch/powerpc/kvm/book3s_mmu_hpte.c | |||
@@ -31,14 +31,6 @@ | |||
31 | 31 | ||
32 | #define PTE_SIZE 12 | 32 | #define PTE_SIZE 12 |
33 | 33 | ||
34 | /* #define DEBUG_MMU */ | ||
35 | |||
36 | #ifdef DEBUG_MMU | ||
37 | #define dprintk_mmu(a, ...) printk(KERN_INFO a, __VA_ARGS__) | ||
38 | #else | ||
39 | #define dprintk_mmu(a, ...) do { } while(0) | ||
40 | #endif | ||
41 | |||
42 | static struct kmem_cache *hpte_cache; | 34 | static struct kmem_cache *hpte_cache; |
43 | 35 | ||
44 | static inline u64 kvmppc_mmu_hash_pte(u64 eaddr) | 36 | static inline u64 kvmppc_mmu_hash_pte(u64 eaddr) |
@@ -186,9 +178,7 @@ static void kvmppc_mmu_pte_flush_long(struct kvm_vcpu *vcpu, ulong guest_ea) | |||
186 | 178 | ||
187 | void kvmppc_mmu_pte_flush(struct kvm_vcpu *vcpu, ulong guest_ea, ulong ea_mask) | 179 | void kvmppc_mmu_pte_flush(struct kvm_vcpu *vcpu, ulong guest_ea, ulong ea_mask) |
188 | { | 180 | { |
189 | dprintk_mmu("KVM: Flushing %d Shadow PTEs: 0x%lx & 0x%lx\n", | 181 | trace_kvm_book3s_mmu_flush("", vcpu, guest_ea, ea_mask); |
190 | vcpu->arch.hpte_cache_count, guest_ea, ea_mask); | ||
191 | |||
192 | guest_ea &= ea_mask; | 182 | guest_ea &= ea_mask; |
193 | 183 | ||
194 | switch (ea_mask) { | 184 | switch (ea_mask) { |
@@ -251,8 +241,7 @@ static void kvmppc_mmu_pte_vflush_long(struct kvm_vcpu *vcpu, u64 guest_vp) | |||
251 | 241 | ||
252 | void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 guest_vp, u64 vp_mask) | 242 | void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 guest_vp, u64 vp_mask) |
253 | { | 243 | { |
254 | dprintk_mmu("KVM: Flushing %d Shadow vPTEs: 0x%llx & 0x%llx\n", | 244 | trace_kvm_book3s_mmu_flush("v", vcpu, guest_vp, vp_mask); |
255 | vcpu->arch.hpte_cache_count, guest_vp, vp_mask); | ||
256 | guest_vp &= vp_mask; | 245 | guest_vp &= vp_mask; |
257 | 246 | ||
258 | switch(vp_mask) { | 247 | switch(vp_mask) { |
@@ -274,8 +263,7 @@ void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end) | |||
274 | struct hpte_cache *pte; | 263 | struct hpte_cache *pte; |
275 | int i; | 264 | int i; |
276 | 265 | ||
277 | dprintk_mmu("KVM: Flushing %d Shadow pPTEs: 0x%lx - 0x%lx\n", | 266 | trace_kvm_book3s_mmu_flush("p", vcpu, pa_start, pa_end); |
278 | vcpu->arch.hpte_cache_count, pa_start, pa_end); | ||
279 | 267 | ||
280 | rcu_read_lock(); | 268 | rcu_read_lock(); |
281 | 269 | ||
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h index 06ad93e40648..23f757a69163 100644 --- a/arch/powerpc/kvm/trace.h +++ b/arch/powerpc/kvm/trace.h | |||
@@ -239,6 +239,29 @@ TRACE_EVENT(kvm_book3s_mmu_invalidate, | |||
239 | __entry->vpage, __entry->raddr, __entry->flags) | 239 | __entry->vpage, __entry->raddr, __entry->flags) |
240 | ); | 240 | ); |
241 | 241 | ||
242 | TRACE_EVENT(kvm_book3s_mmu_flush, | ||
243 | TP_PROTO(const char *type, struct kvm_vcpu *vcpu, unsigned long long p1, | ||
244 | unsigned long long p2), | ||
245 | TP_ARGS(type, vcpu, p1, p2), | ||
246 | |||
247 | TP_STRUCT__entry( | ||
248 | __field( int, count ) | ||
249 | __field( unsigned long long, p1 ) | ||
250 | __field( unsigned long long, p2 ) | ||
251 | __field( const char *, type ) | ||
252 | ), | ||
253 | |||
254 | TP_fast_assign( | ||
255 | __entry->count = vcpu->arch.hpte_cache_count; | ||
256 | __entry->p1 = p1; | ||
257 | __entry->p2 = p2; | ||
258 | __entry->type = type; | ||
259 | ), | ||
260 | |||
261 | TP_printk("Flush %d %sPTEs: %llx - %llx", | ||
262 | __entry->count, __entry->type, __entry->p1, __entry->p2) | ||
263 | ); | ||
264 | |||
242 | #endif /* CONFIG_PPC_BOOK3S */ | 265 | #endif /* CONFIG_PPC_BOOK3S */ |
243 | 266 | ||
244 | #endif /* _TRACE_KVM_H */ | 267 | #endif /* _TRACE_KVM_H */ |