From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
KVM list <kvm@vger.kernel.org>
Subject: [PATCH 10/26] KVM: PPC: Move slb debugging to tracepoints
Date: Tue, 17 Aug 2010 15:57:45 +0200 [thread overview]
Message-ID: <1282053481-18787-11-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1282053481-18787-1-git-send-email-agraf@suse.de>
This patch moves debugging printks for shadow SLB debugging over to tracepoints.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kvm/book3s_64_mmu_host.c | 22 ++--------
arch/powerpc/kvm/trace.h | 73 +++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index ebb1b5d..321c931 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -33,14 +33,6 @@
#define PTE_SIZE 12
#define VSID_ALL 0
-/* #define DEBUG_SLB */
-
-#ifdef DEBUG_SLB
-#define dprintk_slb(a, ...) printk(KERN_INFO a, __VA_ARGS__)
-#else
-#define dprintk_slb(a, ...) do { } while(0)
-#endif
-
void kvmppc_mmu_invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
{
ppc_md.hpte_invalidate(pte->slot, pte->host_va,
@@ -66,20 +58,17 @@ static struct kvmppc_sid_map *find_sid_vsid(struct kvm_vcpu *vcpu, u64 gvsid)
sid_map_mask = kvmppc_sid_hash(vcpu, gvsid);
map = &to_book3s(vcpu)->sid_map[sid_map_mask];
if (map->valid && (map->guest_vsid == gvsid)) {
- dprintk_slb("SLB: Searching: 0x%llx -> 0x%llx\n",
- gvsid, map->host_vsid);
+ trace_kvm_book3s_slb_found(gvsid, map->host_vsid);
return map;
}
map = &to_book3s(vcpu)->sid_map[SID_MAP_MASK - sid_map_mask];
if (map->valid && (map->guest_vsid == gvsid)) {
- dprintk_slb("SLB: Searching 0x%llx -> 0x%llx\n",
- gvsid, map->host_vsid);
+ trace_kvm_book3s_slb_found(gvsid, map->host_vsid);
return map;
}
- dprintk_slb("SLB: Searching %d/%d: 0x%llx -> not found\n",
- sid_map_mask, SID_MAP_MASK - sid_map_mask, gvsid);
+ trace_kvm_book3s_slb_fail(sid_map_mask, gvsid);
return NULL;
}
@@ -205,8 +194,7 @@ static struct kvmppc_sid_map *create_sid_map(struct kvm_vcpu *vcpu, u64 gvsid)
map->guest_vsid = gvsid;
map->valid = true;
- dprintk_slb("SLB: New mapping at %d: 0x%llx -> 0x%llx\n",
- sid_map_mask, gvsid, map->host_vsid);
+ trace_kvm_book3s_slb_map(sid_map_mask, gvsid, map->host_vsid);
return map;
}
@@ -278,7 +266,7 @@ int kvmppc_mmu_map_segment(struct kvm_vcpu *vcpu, ulong eaddr)
to_svcpu(vcpu)->slb[slb_index].esid = slb_esid;
to_svcpu(vcpu)->slb[slb_index].vsid = slb_vsid;
- dprintk_slb("slbmte %#llx, %#llx\n", slb_vsid, slb_esid);
+ trace_kvm_book3s_slbmte(slb_vsid, slb_esid);
return 0;
}
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h
index df15d02..705c63d 100644
--- a/arch/powerpc/kvm/trace.h
+++ b/arch/powerpc/kvm/trace.h
@@ -255,6 +255,79 @@ TRACE_EVENT(kvm_book3s_mmu_flush,
__entry->count, __entry->type, __entry->p1, __entry->p2)
);
+TRACE_EVENT(kvm_book3s_slb_found,
+ TP_PROTO(unsigned long long gvsid, unsigned long long hvsid),
+ TP_ARGS(gvsid, hvsid),
+
+ TP_STRUCT__entry(
+ __field( unsigned long long, gvsid )
+ __field( unsigned long long, hvsid )
+ ),
+
+ TP_fast_assign(
+ __entry->gvsid = gvsid;
+ __entry->hvsid = hvsid;
+ ),
+
+ TP_printk("%llx -> %llx", __entry->gvsid, __entry->hvsid)
+);
+
+TRACE_EVENT(kvm_book3s_slb_fail,
+ TP_PROTO(u16 sid_map_mask, unsigned long long gvsid),
+ TP_ARGS(sid_map_mask, gvsid),
+
+ TP_STRUCT__entry(
+ __field( unsigned short, sid_map_mask )
+ __field( unsigned long long, gvsid )
+ ),
+
+ TP_fast_assign(
+ __entry->sid_map_mask = sid_map_mask;
+ __entry->gvsid = gvsid;
+ ),
+
+ TP_printk("%x/%x: %llx", __entry->sid_map_mask,
+ SID_MAP_MASK - __entry->sid_map_mask, __entry->gvsid)
+);
+
+TRACE_EVENT(kvm_book3s_slb_map,
+ TP_PROTO(u16 sid_map_mask, unsigned long long gvsid,
+ unsigned long long hvsid),
+ TP_ARGS(sid_map_mask, gvsid, hvsid),
+
+ TP_STRUCT__entry(
+ __field( unsigned short, sid_map_mask )
+ __field( unsigned long long, guest_vsid )
+ __field( unsigned long long, host_vsid )
+ ),
+
+ TP_fast_assign(
+ __entry->sid_map_mask = sid_map_mask;
+ __entry->guest_vsid = gvsid;
+ __entry->host_vsid = hvsid;
+ ),
+
+ TP_printk("%x: %llx -> %llx", __entry->sid_map_mask,
+ __entry->guest_vsid, __entry->host_vsid)
+);
+
+TRACE_EVENT(kvm_book3s_slbmte,
+ TP_PROTO(u64 slb_vsid, u64 slb_esid),
+ TP_ARGS(slb_vsid, slb_esid),
+
+ TP_STRUCT__entry(
+ __field( u64, slb_vsid )
+ __field( u64, slb_esid )
+ ),
+
+ TP_fast_assign(
+ __entry->slb_vsid = slb_vsid;
+ __entry->slb_esid = slb_esid;
+ ),
+
+ TP_printk("%llx, %llx", __entry->slb_vsid, __entry->slb_esid)
+);
+
#endif /* _TRACE_KVM_H */
/* This part must be outside protection */
--
1.6.0.2
next prev parent reply other threads:[~2010-08-17 13:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 13:57 [PATCH 00/26] KVM: PPC: Mid-August patch queue Alexander Graf
2010-08-17 13:57 ` [PATCH 01/26] KVM: PPC: Move EXIT_DEBUG partially to tracepoints Alexander Graf
2010-08-17 13:57 ` [PATCH 02/26] KVM: PPC: Move book3s_64 mmu map debug print to trace point Alexander Graf
2010-08-17 13:57 ` [PATCH 03/26] KVM: PPC: Add tracepoint for generic mmu map Alexander Graf
2010-08-17 13:57 ` [PATCH 04/26] KVM: PPC: Move pte invalidate debug code to tracepoint Alexander Graf
2010-08-17 13:57 ` [PATCH 05/26] KVM: PPC: Fix sid map search after flush Alexander Graf
2010-08-17 13:57 ` [PATCH 06/26] KVM: PPC: Add tracepoints for generic spte flushes Alexander Graf
2010-08-17 13:57 ` [PATCH 07/26] KVM: PPC: Preload magic page when in kernel mode Alexander Graf
2010-08-17 13:57 ` [PATCH 08/26] KVM: PPC: Don't flush PTEs on NX/RO hit Alexander Graf
2010-08-17 13:57 ` [PATCH 09/26] KVM: PPC: Make invalidation code more reliable Alexander Graf
2010-08-17 13:57 ` Alexander Graf [this message]
2010-08-17 13:57 ` [PATCH 11/26] KVM: PPC: Revert "KVM: PPC: Use kernel hash function" Alexander Graf
2010-08-17 13:57 ` [PATCH 12/26] KVM: PPC: Remove unused define Alexander Graf
2010-08-17 13:57 ` [PATCH 13/26] KVM: PPC: Add feature bitmap for magic page Alexander Graf
2010-08-22 16:42 ` Avi Kivity
2010-08-31 0:56 ` Alexander Graf
2010-08-31 6:28 ` Avi Kivity
2010-08-17 13:57 ` [PATCH 14/26] KVM: PPC: Move BAT handling code into spr handler Alexander Graf
2010-08-17 13:57 ` [PATCH 15/26] KVM: PPC: Interpret SR registers on demand Alexander Graf
2010-08-17 13:57 ` [PATCH 16/26] KVM: PPC: Put segment registers in shared page Alexander Graf
2010-08-17 13:57 ` [PATCH 17/26] KVM: PPC: Add mtsrin PV code Alexander Graf
2010-08-17 13:57 ` [PATCH 18/26] KVM: PPC: Make PV mtmsr work with r30 and r31 Alexander Graf
2010-08-17 13:57 ` [PATCH 19/26] KVM: PPC: Update int_pending also on dequeue Alexander Graf
2010-08-17 13:57 ` [PATCH 20/26] KVM: PPC: Make PV mtmsrd L=1 work with r30 and r31 Alexander Graf
2010-08-17 13:57 ` [PATCH 21/26] KVM: PPC: Force enable nap on KVM Alexander Graf
2010-08-17 18:28 ` Scott Wood
2010-08-17 20:07 ` Alexander Graf
2010-08-17 13:57 ` [PATCH 22/26] KVM: PPC: Implement correct SID mapping on Book3s_32 Alexander Graf
2010-08-17 13:57 ` [PATCH 23/26] KVM: PPC: Don't put MSR_POW in MSR Alexander Graf
2010-08-17 13:57 ` [PATCH 24/26] KVM: PPC: initialize IVORs in addition to IVPR Alexander Graf
2010-08-17 13:58 ` [PATCH 25/26] KVM: PPC: fix compilation of "dump tlbs" debug function Alexander Graf
2010-08-17 13:58 ` [PATCH 26/26] KVM: PPC: allow ppc440gp to pass the compatibility check Alexander Graf
2010-08-22 16:46 ` [PATCH 00/26] KVM: PPC: Mid-August patch queue Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282053481-18787-11-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).