From: Paolo Bonzini Date: Fri, 11 Jun 2021 10:32:56 +0000 Subject: Re: [PATCH v7 2/4] KVM: stats: Add fd-based API to read binary stats data Message-Id: <2ed4afbf-c5b8-82a5-5fc6-04f00f933761@redhat.com> List-Id: References: <20210603211426.790093-1-jingzhangos@google.com> <20210603211426.790093-3-jingzhangos@google.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jing Zhang Cc: KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan On 11/06/21 00:47, Jing Zhang wrote: > Hi Paolo, > > On Thu, Jun 10, 2021 at 11:23 AM Paolo Bonzini wrote: >> >> On 03/06/21 23:14, Jing Zhang wrote: >>> +#define DEFINE_VM_STATS_DESC(...) { \ >>> + STATS_DESC_COUNTER("remote_tlb_flush"), \ >>> + ## __VA_ARGS__ \ >>> +} >>> + >>> +#define DEFINE_VCPU_STATS_DESC(...) { \ >>> + STATS_DESC_COUNTER("halt_successful_poll"), \ >>> + STATS_DESC_COUNTER("halt_attempted_poll"), \ >>> + STATS_DESC_COUNTER("halt_poll_invalid"), \ >>> + STATS_DESC_COUNTER("halt_wakeup"), \ >>> + STATS_DESC_TIME_NSEC("halt_poll_success_ns"), \ >>> + STATS_DESC_TIME_NSEC("halt_poll_fail_ns"), \ >>> + ## __VA_ARGS__ \ >> >> Let's instead put this (note it's without braces) in macros like these >> >> #define KVM_GENERIC_VM_STATS() \ >> STATS_DESC_COUNTER("remote_tlb_flush"), >> >> #define KVM_GENERIC_VCPU_STATS(...) \ >> STATS_DESC_COUNTER("halt_successful_poll"), \ >> STATS_DESC_COUNTER("halt_attempted_poll"), \ >> STATS_DESC_COUNTER("halt_poll_invalid"), \ >> STATS_DESC_COUNTER("halt_wakeup"), \ >> STATS_DESC_TIME_NSEC("halt_poll_success_ns"), \ >> STATS_DESC_TIME_NSEC("halt_poll_fail_ns"), >> >> and it can be used in the arch files. In fact it can even be added in patch 1 and >> switched to STATS_DESC_* here. >> >> Paolo >> > I just remember that the reason I used braces is due to following > error from checkpatch.pl: > ERROR: Macros with complex values should be enclosed in parentheses No, just ignore the bogus error from checkpatch.pl. But, thanks for checking! Paolo