Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1217378 > unrolled thread
| Started by | Wanpeng Li <wanpeng.li@hotmail.com> |
|---|---|
| First post | 2015-09-02 09:50 +0200 |
| Last post | 2015-09-03 01:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink Wanpeng Li <wanpeng.li@hotmail.com> - 2015-09-02 09:50 +0200
Re: [PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink David Matlack <dmatlack@google.com> - 2015-09-02 20:20 +0200
Re: [PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink Wanpeng Li <wanpeng.li@hotmail.com> - 2015-09-03 01:20 +0200
| From | Wanpeng Li <wanpeng.li@hotmail.com> |
|---|---|
| Date | 2015-09-02 09:50 +0200 |
| Subject | [PATCH v6 3/3] KVM: trace kvm_halt_poll_ns grow/shrink |
| Message-ID | <q4aXU-73z-5@gated-at.bofh.it> |
Tracepoint for dynamic halt_pool_ns, fired on every potential change.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
include/trace/events/kvm.h | 30 ++++++++++++++++++++++++++++++
virt/kvm/kvm_main.c | 8 ++++++--
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index a44062d..75ddf80 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -356,6 +356,36 @@ TRACE_EVENT(
__entry->address)
);
+TRACE_EVENT(kvm_halt_poll_ns,
+ TP_PROTO(bool grow, unsigned int vcpu_id, int new, int old),
+ TP_ARGS(grow, vcpu_id, new, old),
+
+ TP_STRUCT__entry(
+ __field(bool, 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: halt_pool_ns %d (%s %d)",
+ __entry->vcpu_id,
+ __entry->new,
+ __entry->grow ? "grow" : "shrink",
+ __entry->old)
+);
+
+#define trace_kvm_halt_poll_ns_grow(vcpu_id, new, old) \
+ trace_kvm_halt_poll_ns(true, vcpu_id, new, old)
+#define trace_kvm_halt_poll_ns_shrink(vcpu_id, new, old) \
+ trace_kvm_halt_poll_ns(false, vcpu_id, new, old)
+
#endif
#endif /* _TRACE_KVM_MAIN_H */
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 3cff02f..fee339e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1918,8 +1918,9 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_mark_page_dirty);
static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
{
- int val = vcpu->halt_poll_ns;
+ int old, val;
+ old = val = vcpu->halt_poll_ns;
/* 10us base */
if (val == 0 && halt_poll_ns_grow)
val = 10000;
@@ -1927,18 +1928,21 @@ static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
val *= halt_poll_ns_grow;
vcpu->halt_poll_ns = val;
+ trace_kvm_halt_poll_ns_grow(vcpu->vcpu_id, val, old);
}
static void shrink_halt_poll_ns(struct kvm_vcpu *vcpu)
{
- int val = vcpu->halt_poll_ns;
+ int old, val;
+ old = val = vcpu->halt_poll_ns;
if (halt_poll_ns_shrink == 0)
val = 0;
else
val /= halt_poll_ns_shrink;
vcpu->halt_poll_ns = val;
+ trace_kvm_halt_poll_ns_shrink(vcpu->vcpu_id, val, old);
}
static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu)
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | David Matlack <dmatlack@google.com> |
|---|---|
| Date | 2015-09-02 20:20 +0200 |
| Message-ID | <q4kNA-4qF-15@gated-at.bofh.it> |
| In reply to | #1217378 |
On Wed, Sep 2, 2015 at 12:42 AM, Wanpeng Li <wanpeng.li@hotmail.com> wrote:
> Tracepoint for dynamic halt_pool_ns, fired on every potential change.
>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> include/trace/events/kvm.h | 30 ++++++++++++++++++++++++++++++
> virt/kvm/kvm_main.c | 8 ++++++--
> 2 files changed, 36 insertions(+), 2 deletions(-)
>
> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
> index a44062d..75ddf80 100644
> --- a/include/trace/events/kvm.h
> +++ b/include/trace/events/kvm.h
> @@ -356,6 +356,36 @@ TRACE_EVENT(
> __entry->address)
> );
>
> +TRACE_EVENT(kvm_halt_poll_ns,
> + TP_PROTO(bool grow, unsigned int vcpu_id, int new, int old),
> + TP_ARGS(grow, vcpu_id, new, old),
> +
> + TP_STRUCT__entry(
> + __field(bool, 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: halt_pool_ns %d (%s %d)",
s/pool/poll/
> + __entry->vcpu_id,
> + __entry->new,
> + __entry->grow ? "grow" : "shrink",
> + __entry->old)
> +);
> +
> +#define trace_kvm_halt_poll_ns_grow(vcpu_id, new, old) \
> + trace_kvm_halt_poll_ns(true, vcpu_id, new, old)
> +#define trace_kvm_halt_poll_ns_shrink(vcpu_id, new, old) \
> + trace_kvm_halt_poll_ns(false, vcpu_id, new, old)
> +
> #endif
>
> #endif /* _TRACE_KVM_MAIN_H */
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 3cff02f..fee339e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1918,8 +1918,9 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_mark_page_dirty);
>
> static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
> {
> - int val = vcpu->halt_poll_ns;
> + int old, val;
>
> + old = val = vcpu->halt_poll_ns;
> /* 10us base */
> if (val == 0 && halt_poll_ns_grow)
> val = 10000;
> @@ -1927,18 +1928,21 @@ static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
> val *= halt_poll_ns_grow;
>
> vcpu->halt_poll_ns = val;
> + trace_kvm_halt_poll_ns_grow(vcpu->vcpu_id, val, old);
> }
>
> static void shrink_halt_poll_ns(struct kvm_vcpu *vcpu)
> {
> - int val = vcpu->halt_poll_ns;
> + int old, val;
>
> + old = val = vcpu->halt_poll_ns;
> if (halt_poll_ns_shrink == 0)
> val = 0;
> else
> val /= halt_poll_ns_shrink;
>
> vcpu->halt_poll_ns = val;
> + trace_kvm_halt_poll_ns_shrink(vcpu->vcpu_id, val, old);
> }
>
> static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu)
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Wanpeng Li <wanpeng.li@hotmail.com> |
|---|---|
| Date | 2015-09-03 01:20 +0200 |
| Message-ID | <q4ptT-2FO-9@gated-at.bofh.it> |
| In reply to | #1217790 |
On 9/3/15 2:09 AM, David Matlack wrote:
> On Wed, Sep 2, 2015 at 12:42 AM, Wanpeng Li <wanpeng.li@hotmail.com> wrote:
>> Tracepoint for dynamic halt_pool_ns, fired on every potential change.
>>
>> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
>> ---
>> include/trace/events/kvm.h | 30 ++++++++++++++++++++++++++++++
>> virt/kvm/kvm_main.c | 8 ++++++--
>> 2 files changed, 36 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
>> index a44062d..75ddf80 100644
>> --- a/include/trace/events/kvm.h
>> +++ b/include/trace/events/kvm.h
>> @@ -356,6 +356,36 @@ TRACE_EVENT(
>> __entry->address)
>> );
>>
>> +TRACE_EVENT(kvm_halt_poll_ns,
>> + TP_PROTO(bool grow, unsigned int vcpu_id, int new, int old),
>> + TP_ARGS(grow, vcpu_id, new, old),
>> +
>> + TP_STRUCT__entry(
>> + __field(bool, 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: halt_pool_ns %d (%s %d)",
> s/pool/poll/
Will fix it in next version, thx David! ;-)
Regards,
Wanpeng Li
>
>> + __entry->vcpu_id,
>> + __entry->new,
>> + __entry->grow ? "grow" : "shrink",
>> + __entry->old)
>> +);
>> +
>> +#define trace_kvm_halt_poll_ns_grow(vcpu_id, new, old) \
>> + trace_kvm_halt_poll_ns(true, vcpu_id, new, old)
>> +#define trace_kvm_halt_poll_ns_shrink(vcpu_id, new, old) \
>> + trace_kvm_halt_poll_ns(false, vcpu_id, new, old)
>> +
>> #endif
>>
>> #endif /* _TRACE_KVM_MAIN_H */
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 3cff02f..fee339e 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -1918,8 +1918,9 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_mark_page_dirty);
>>
>> static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
>> {
>> - int val = vcpu->halt_poll_ns;
>> + int old, val;
>>
>> + old = val = vcpu->halt_poll_ns;
>> /* 10us base */
>> if (val == 0 && halt_poll_ns_grow)
>> val = 10000;
>> @@ -1927,18 +1928,21 @@ static void grow_halt_poll_ns(struct kvm_vcpu *vcpu)
>> val *= halt_poll_ns_grow;
>>
>> vcpu->halt_poll_ns = val;
>> + trace_kvm_halt_poll_ns_grow(vcpu->vcpu_id, val, old);
>> }
>>
>> static void shrink_halt_poll_ns(struct kvm_vcpu *vcpu)
>> {
>> - int val = vcpu->halt_poll_ns;
>> + int old, val;
>>
>> + old = val = vcpu->halt_poll_ns;
>> if (halt_poll_ns_shrink == 0)
>> val = 0;
>> else
>> val /= halt_poll_ns_shrink;
>>
>> vcpu->halt_poll_ns = val;
>> + trace_kvm_halt_poll_ns_shrink(vcpu->vcpu_id, val, old);
>> }
>>
>> static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu)
>> --
>> 1.9.1
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web