* [PATCH] KVM: trace events: update list of exit reasons
@ 2017-09-14 9:50 Ladi Prosek
2017-09-14 10:06 ` Cornelia Huck
2017-09-15 11:27 ` Paolo Bonzini
0 siblings, 2 replies; 7+ messages in thread
From: Ladi Prosek @ 2017-09-14 9:50 UTC (permalink / raw)
To: kvm
Adding entries for exit reasons 23 - 27:
KVM_EXIT_EPR
KVM_EXIT_SYSTEM_EVENT
KVM_EXIT_S390_STSI
KVM_EXIT_IOAPIC_EOI
KVM_EXIT_HYPERV
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
---
include/trace/events/kvm.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index 8ade3eb..dcffedf 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -14,7 +14,9 @@
ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \
ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\
ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \
- ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH)
+ ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH), ERSN(EPR),\
+ ERSN(SYSTEM_EVENT), ERSN(S390_STSI), ERSN(IOAPIC_EOI), \
+ ERSN(HYPERV)
TRACE_EVENT(kvm_userspace_exit,
TP_PROTO(__u32 reason, int errno),
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] KVM: trace events: update list of exit reasons
2017-09-14 9:50 [PATCH] KVM: trace events: update list of exit reasons Ladi Prosek
@ 2017-09-14 10:06 ` Cornelia Huck
2017-09-14 18:07 ` Radim Krčmář
2017-09-15 11:27 ` Paolo Bonzini
1 sibling, 1 reply; 7+ messages in thread
From: Cornelia Huck @ 2017-09-14 10:06 UTC (permalink / raw)
To: Ladi Prosek; +Cc: kvm
On Thu, 14 Sep 2017 11:50:07 +0200
Ladi Prosek <lprosek@redhat.com> wrote:
> Adding entries for exit reasons 23 - 27:
>
> KVM_EXIT_EPR
> KVM_EXIT_SYSTEM_EVENT
> KVM_EXIT_S390_STSI
> KVM_EXIT_IOAPIC_EOI
> KVM_EXIT_HYPERV
>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---
> include/trace/events/kvm.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
> index 8ade3eb..dcffedf 100644
> --- a/include/trace/events/kvm.h
> +++ b/include/trace/events/kvm.h
> @@ -14,7 +14,9 @@
> ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \
> ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\
> ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \
> - ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH)
> + ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH), ERSN(EPR),\
> + ERSN(SYSTEM_EVENT), ERSN(S390_STSI), ERSN(IOAPIC_EOI), \
> + ERSN(HYPERV)
>
> TRACE_EVENT(kvm_userspace_exit,
> TP_PROTO(__u32 reason, int errno),
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
/me wonders whether there is a way to avoid them running out of sync...
but otoh, not so many exit reasons are being added anyway.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] KVM: trace events: update list of exit reasons
2017-09-14 10:06 ` Cornelia Huck
@ 2017-09-14 18:07 ` Radim Krčmář
2017-09-15 7:30 ` Cornelia Huck
2017-09-15 11:17 ` Ladi Prosek
0 siblings, 2 replies; 7+ messages in thread
From: Radim Krčmář @ 2017-09-14 18:07 UTC (permalink / raw)
To: Cornelia Huck; +Cc: Ladi Prosek, kvm
2017-09-14 12:06+0200, Cornelia Huck:
> On Thu, 14 Sep 2017 11:50:07 +0200
> Ladi Prosek <lprosek@redhat.com> wrote:
>
>> Adding entries for exit reasons 23 - 27:
>>
>> KVM_EXIT_EPR
>> KVM_EXIT_SYSTEM_EVENT
>> KVM_EXIT_S390_STSI
>> KVM_EXIT_IOAPIC_EOI
>> KVM_EXIT_HYPERV
>>
>> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
>> ---
>> include/trace/events/kvm.h | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
>> index 8ade3eb..dcffedf 100644
>> --- a/include/trace/events/kvm.h
>> +++ b/include/trace/events/kvm.h
>> @@ -14,7 +14,9 @@
>> ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \
>> ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\
>> ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \
>> - ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH)
>> + ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH), ERSN(EPR),\
>> + ERSN(SYSTEM_EVENT), ERSN(S390_STSI), ERSN(IOAPIC_EOI), \
>> + ERSN(HYPERV)
>>
>> TRACE_EVENT(kvm_userspace_exit,
>> TP_PROTO(__u32 reason, int errno),
Applied, thanks.
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>
> /me wonders whether there is a way to avoid them running out of sync...
If we do not want to generate it with an external script, I think the
simplest is to have a separate file that looks like
#define kvm_exit_reasons \
KVM_EXIT(UNKNOWN, 0), \
KVM_EXIT(EXCEPTION, 1), \
...
KVM_EXIT(HYPERV, 27) \
and include it from both places. The current exit definitions would be
#define KVM_EXIT(reason, code)
KVM_EXIT_ ## reason = code
#include <the/magic/file>
enum {
kvm_exit_reasons
};
#undef kvm_exit_reasons
and the trace
#define KVM_EXIT(reason, code)
{ code, "KVM_EXIT_" # reason }
#include <the/magic/file>
...
__print_symbolic(__entry->reason, kvm_exit_reasons),
...
#undef kvm_exit_reasons
(Would also work with just "KVM_EXIT(UNKNOWN), ..." and small tweaks.)
> but otoh, not so many exit reasons are being added anyway.
Yes. :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] KVM: trace events: update list of exit reasons
2017-09-14 18:07 ` Radim Krčmář
@ 2017-09-15 7:30 ` Cornelia Huck
2017-09-15 10:20 ` Paolo Bonzini
2017-09-15 11:17 ` Ladi Prosek
1 sibling, 1 reply; 7+ messages in thread
From: Cornelia Huck @ 2017-09-15 7:30 UTC (permalink / raw)
To: Radim Krčmář; +Cc: Ladi Prosek, kvm
On Thu, 14 Sep 2017 20:07:37 +0200
Radim Krčmář <rkrcmar@redhat.com> wrote:
> 2017-09-14 12:06+0200, Cornelia Huck:
> > /me wonders whether there is a way to avoid them running out of sync...
>
> If we do not want to generate it with an external script, I think the
> simplest is to have a separate file that looks like
>
> #define kvm_exit_reasons \
> KVM_EXIT(UNKNOWN, 0), \
> KVM_EXIT(EXCEPTION, 1), \
> ...
> KVM_EXIT(HYPERV, 27) \
>
> and include it from both places. The current exit definitions would be
>
> #define KVM_EXIT(reason, code)
> KVM_EXIT_ ## reason = code
>
> #include <the/magic/file>
>
> enum {
> kvm_exit_reasons
> };
>
> #undef kvm_exit_reasons
>
> and the trace
>
> #define KVM_EXIT(reason, code)
> { code, "KVM_EXIT_" # reason }
> #include <the/magic/file>
>
> ...
>
> __print_symbolic(__entry->reason, kvm_exit_reasons),
>
> ...
>
> #undef kvm_exit_reasons
>
> (Would also work with just "KVM_EXIT(UNKNOWN), ..." and small tweaks.)
>
> > but otoh, not so many exit reasons are being added anyway.
>
> Yes. :)
Yeah, your approach would work, but it's unlikely to be worth it :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] KVM: trace events: update list of exit reasons
2017-09-15 7:30 ` Cornelia Huck
@ 2017-09-15 10:20 ` Paolo Bonzini
0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2017-09-15 10:20 UTC (permalink / raw)
To: Cornelia Huck, Radim Krčmář; +Cc: Ladi Prosek, kvm
On 15/09/2017 09:30, Cornelia Huck wrote:
> On Thu, 14 Sep 2017 20:07:37 +0200
> Radim Krčmář <rkrcmar@redhat.com> wrote:
>
>> 2017-09-14 12:06+0200, Cornelia Huck:
>
>>> /me wonders whether there is a way to avoid them running out of sync...
>>
>> If we do not want to generate it with an external script, I think the
>> simplest is to have a separate file that looks like
>>
>> #define kvm_exit_reasons \
>> KVM_EXIT(UNKNOWN, 0), \
>> KVM_EXIT(EXCEPTION, 1), \
>> ...
>> KVM_EXIT(HYPERV, 27) \
>>
>> and include it from both places. The current exit definitions would be
>>
>> #define KVM_EXIT(reason, code)
>> KVM_EXIT_ ## reason = code
>>
>> #include <the/magic/file>
>>
>> enum {
>> kvm_exit_reasons
>> };
>>
>> #undef kvm_exit_reasons
>>
>> and the trace
>>
>> #define KVM_EXIT(reason, code)
>> { code, "KVM_EXIT_" # reason }
>> #include <the/magic/file>
>>
>> ...
>>
>> __print_symbolic(__entry->reason, kvm_exit_reasons),
>>
>> ...
>>
>> #undef kvm_exit_reasons
>>
>> (Would also work with just "KVM_EXIT(UNKNOWN), ..." and small tweaks.)
>>
>>> but otoh, not so many exit reasons are being added anyway.
>>
>> Yes. :)
>
> Yeah, your approach would work, but it's unlikely to be worth it :)
The next one who adds an exit reason will do it then. :)
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] KVM: trace events: update list of exit reasons
2017-09-14 18:07 ` Radim Krčmář
2017-09-15 7:30 ` Cornelia Huck
@ 2017-09-15 11:17 ` Ladi Prosek
1 sibling, 0 replies; 7+ messages in thread
From: Ladi Prosek @ 2017-09-15 11:17 UTC (permalink / raw)
To: Radim Krčmář; +Cc: Cornelia Huck, KVM list
On Thu, Sep 14, 2017 at 8:07 PM, Radim Krčmář <rkrcmar@redhat.com> wrote:
> If we do not want to generate it with an external script, I think the
> simplest is to have a separate file that looks like
>
> #define kvm_exit_reasons \
> KVM_EXIT(UNKNOWN, 0), \
> KVM_EXIT(EXCEPTION, 1), \
> ...
> KVM_EXIT(HYPERV, 27) \
>
> and include it from both places. The current exit definitions would be
>
> #define KVM_EXIT(reason, code)
> KVM_EXIT_ ## reason = code
>
> #include <the/magic/file>
>
> enum {
> kvm_exit_reasons
> };
>
> #undef kvm_exit_reasons
>
> and the trace
>
> #define KVM_EXIT(reason, code)
> { code, "KVM_EXIT_" # reason }
> #include <the/magic/file>
>
> ...
>
> __print_symbolic(__entry->reason, kvm_exit_reasons),
>
> ...
>
> #undef kvm_exit_reasons
>
> (Would also work with just "KVM_EXIT(UNKNOWN), ..." and small tweaks.)
It can be done without a separate file:
#define kvm_exit_reasons \
KVM_EXIT(UNKNOWN, 0), \
KVM_EXIT(EXCEPTION, 1), \
...
KVM_EXIT(HYPERV, 27)
#define KVM_EXIT(reason, code) \
KVM_EXIT_ ## reason = code
enum {
kvm_exit_reasons
};
#undef KVM_EXIT
^^^ goes in the general header
#define KVM_EXIT(reason, code) \
{ code, "KVM_EXIT_" # reason }
... _reasons[] = {
kvm_exit_reasons
};
#undef KVM_EXIT
^^^ goes in the trace header
I.e. this is symbol manipulation, no need to have KVM_EXIT defined
when it's "used".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] KVM: trace events: update list of exit reasons
2017-09-14 9:50 [PATCH] KVM: trace events: update list of exit reasons Ladi Prosek
2017-09-14 10:06 ` Cornelia Huck
@ 2017-09-15 11:27 ` Paolo Bonzini
1 sibling, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2017-09-15 11:27 UTC (permalink / raw)
To: Ladi Prosek, kvm
On 14/09/2017 11:50, Ladi Prosek wrote:
> Adding entries for exit reasons 23 - 27:
>
> KVM_EXIT_EPR
> KVM_EXIT_SYSTEM_EVENT
> KVM_EXIT_S390_STSI
> KVM_EXIT_IOAPIC_EOI
> KVM_EXIT_HYPERV
>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---
> include/trace/events/kvm.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
> index 8ade3eb..dcffedf 100644
> --- a/include/trace/events/kvm.h
> +++ b/include/trace/events/kvm.h
> @@ -14,7 +14,9 @@
> ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \
> ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\
> ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \
> - ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH)
> + ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH), ERSN(EPR),\
> + ERSN(SYSTEM_EVENT), ERSN(S390_STSI), ERSN(IOAPIC_EOI), \
> + ERSN(HYPERV)
>
> TRACE_EVENT(kvm_userspace_exit,
> TP_PROTO(__u32 reason, int errno),
>
Applied, thanks.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-09-15 11:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 9:50 [PATCH] KVM: trace events: update list of exit reasons Ladi Prosek
2017-09-14 10:06 ` Cornelia Huck
2017-09-14 18:07 ` Radim Krčmář
2017-09-15 7:30 ` Cornelia Huck
2017-09-15 10:20 ` Paolo Bonzini
2017-09-15 11:17 ` Ladi Prosek
2017-09-15 11:27 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox