From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: trace events: update list of exit reasons Date: Thu, 14 Sep 2017 20:07:37 +0200 Message-ID: <20170914180733.GC23415@flask> References: <20170914095007.21331-1-lprosek@redhat.com> <20170914120646.49139c2a.cohuck@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ladi Prosek , kvm@vger.kernel.org To: Cornelia Huck Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58520 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbdINSHp (ORCPT ); Thu, 14 Sep 2017 14:07:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD32813A56 for ; Thu, 14 Sep 2017 18:07:45 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20170914120646.49139c2a.cohuck@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-09-14 12:06+0200, Cornelia Huck: > On Thu, 14 Sep 2017 11:50:07 +0200 > 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 >> --- >> 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 > > /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 enum { kvm_exit_reasons }; #undef kvm_exit_reasons and the trace #define KVM_EXIT(reason, code) { code, "KVM_EXIT_" # reason } #include ... __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. :)