From: Cornelia Huck <cohuck@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ladi Prosek <lprosek@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: trace events: update list of exit reasons
Date: Fri, 15 Sep 2017 09:30:06 +0200 [thread overview]
Message-ID: <20170915093006.3faf1aca.cohuck@redhat.com> (raw)
In-Reply-To: <20170914180733.GC23415@flask>
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 :)
next prev parent reply other threads:[~2017-09-15 7:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-09-15 10:20 ` Paolo Bonzini
2017-09-15 11:17 ` Ladi Prosek
2017-09-15 11:27 ` Paolo Bonzini
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=20170915093006.3faf1aca.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lprosek@redhat.com \
--cc=rkrcmar@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.