From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Gleb Natapov <gleb@kernel.org>,
Raghavendra KT <raghavendra.kt@linux.vnet.ibm.com>,
Vinod Chegu <chegu_vinod@hp.com>, Hui-Zhi <hui-zhi.zhao@hp.com>
Subject: [PATCH 6/9] KVM: trace kvm_ple_window grow/shrink
Date: Tue, 19 Aug 2014 22:35:33 +0200 [thread overview]
Message-ID: <1408480536-8240-7-git-send-email-rkrcmar@redhat.com> (raw)
In-Reply-To: <1408480536-8240-1-git-send-email-rkrcmar@redhat.com>
Tracepoint for dynamic PLE window, fired on every potential change.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
arch/x86/kvm/trace.h | 29 +++++++++++++++++++++++++++++
arch/x86/kvm/vmx.c | 4 ++++
arch/x86/kvm/x86.c | 1 +
3 files changed, 34 insertions(+)
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index e850a7d..e4682f5 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -848,6 +848,35 @@ TRACE_EVENT(kvm_track_tsc,
__print_symbolic(__entry->host_clock, host_clocks))
);
+TRACE_EVENT(kvm_ple_window,
+ TP_PROTO(int grow, unsigned int vcpu_id, int new, int old),
+ TP_ARGS(grow, vcpu_id, new, old),
+
+ TP_STRUCT__entry(
+ __field( int, grow )
+ __field( unsigned int, vcpu_id )
+ __field( int, new )
+ __field( int, old )
+ ),
+
+ TP_fast_assign(
+ __entry->grow = grow;
+ __entry->vcpu_id = vcpu_id;
+ __entry->new = new;
+ __entry->old = old;
+ ),
+
+ TP_printk("vcpu %u: ple_window %d %s %d",
+ __entry->vcpu_id,
+ __entry->new,
+ __entry->grow ? "<+" : "<-",
+ __entry->old)
+);
+#define trace_kvm_ple_window_grow(vcpu_id, new, old) \
+ trace_kvm_ple_window(1, vcpu_id, new, old)
+#define trace_kvm_ple_window_shrink(vcpu_id, new, old) \
+ trace_kvm_ple_window(0, vcpu_id, new, old)
+
#endif /* CONFIG_X86_64 */
#endif /* _TRACE_KVM_H */
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e1192fb..a236a9f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5709,6 +5709,8 @@ static void grow_ple_window(struct kvm_vcpu *vcpu)
new = old + ple_window_grow;
vmx->ple_window = min(new, ple_window_max);
+
+ trace_kvm_ple_window_grow(vcpu->vcpu_id, vmx->ple_window, old);
}
static void shrink_ple_window(struct kvm_vcpu *vcpu)
@@ -5725,6 +5727,8 @@ static void shrink_ple_window(struct kvm_vcpu *vcpu)
new = old - ple_window_shrink;
vmx->ple_window = max(new, ple_window);
+
+ trace_kvm_ple_window_shrink(vcpu->vcpu_id, vmx->ple_window, old);
}
/*
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5696ee7..814b20c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7648,3 +7648,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_invlpga);
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_skinit);
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intercepts);
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_write_tsc_offset);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ple_window);
--
2.0.4
next prev parent reply other threads:[~2014-08-19 20:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 20:35 [PATCH 0/9] Dynamic Pause Loop Exiting window Radim Krčmář
2014-08-19 20:35 ` [PATCH 1/9] KVM: add kvm_arch_sched_in Radim Krčmář
2014-08-20 7:47 ` Christian Borntraeger
2014-08-20 12:56 ` Radim Krčmář
2014-08-19 20:35 ` [PATCH 2/9] KVM: x86: introduce sched_in to kvm_x86_ops Radim Krčmář
2014-08-19 20:35 ` [PATCH 3/9] KVM: VMX: make PLE window per-vcpu Radim Krčmář
2014-08-20 7:13 ` Paolo Bonzini
2014-08-20 12:26 ` Radim Krčmář
2014-08-19 20:35 ` [PATCH 4/9] KVM: VMX: dynamise PLE window Radim Krčmář
2014-08-19 20:35 ` [PATCH 5/9] KVM: VMX: clamp " Radim Krčmář
2014-08-20 7:18 ` Paolo Bonzini
2014-08-20 12:46 ` Radim Krčmář
2014-08-19 20:35 ` Radim Krčmář [this message]
2014-08-19 20:35 ` [PATCH 7/9] KVM: VMX: abstract ple_window modifiers Radim Krčmář
2014-08-20 7:02 ` Paolo Bonzini
2014-08-20 12:25 ` Radim Krčmář
2014-08-19 20:35 ` [PATCH 8/9] KVM: VMX: runtime knobs for dynamic PLE window Radim Krčmář
2014-08-19 20:35 ` [PATCH 9/9] KVM: VMX: automatic PLE window maximum Radim Krčmář
2014-08-20 7:16 ` Paolo Bonzini
2014-08-20 7:18 ` Paolo Bonzini
2014-08-20 12:41 ` Radim Krčmář
2014-08-20 13:15 ` Paolo Bonzini
2014-08-20 15:31 ` Radim Krčmář
2014-08-20 15:34 ` Paolo Bonzini
2014-08-20 16:01 ` Radim Krčmář
2014-08-20 16:03 ` Paolo Bonzini
2014-08-20 16:26 ` Radim Krčmář
2014-08-21 6:48 ` [PATCH 0/9] Dynamic Pause Loop Exiting window Zhao, Hui-Zhi (Steven, HPservers-Core-OE-PSC)
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=1408480536-8240-7-git-send-email-rkrcmar@redhat.com \
--to=rkrcmar@redhat.com \
--cc=chegu_vinod@hp.com \
--cc=gleb@kernel.org \
--cc=hui-zhi.zhao@hp.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=raghavendra.kt@linux.vnet.ibm.com \
/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).