From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FB53C48BE0 for ; Fri, 11 Jun 2021 10:33:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB3E6613EE for ; Fri, 11 Jun 2021 10:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231230AbhFKKfA (ORCPT ); Fri, 11 Jun 2021 06:35:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55042 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231192AbhFKKfA (ORCPT ); Fri, 11 Jun 2021 06:35:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623407581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WBC8jsi6sMgVpUZekFliEqdwU62og4a57VgKDjRa+Sc=; b=Kbo1bduKxHcMlJtsP8EmYeW4thj78zCb6mYjJxCjcEHDDQziKzra0btuJSBLBtM2NrIcSP ws783wS9ByuG9PXIDZD2c91dI3z36f/Rlilt8KSwSW9Nw9/gSyykyX/e7PeD9Mth32Nfwe eOpmaZ3rU9PvTZ2Ex07vi7cQFAQhKJI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-jyy_ElvZOMCJP5hHPDZEIw-1; Fri, 11 Jun 2021 06:33:00 -0400 X-MC-Unique: jyy_ElvZOMCJP5hHPDZEIw-1 Received: by mail-wr1-f70.google.com with SMTP id f22-20020a5d58f60000b029011634e39889so2417504wrd.7 for ; Fri, 11 Jun 2021 03:33:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WBC8jsi6sMgVpUZekFliEqdwU62og4a57VgKDjRa+Sc=; b=kYYU1s9IR9iJICf/SVAwnHusweq2YF/JcVjfLD+zlMQOkXZT0CCo0+yjseJee+m/d5 H2Zs5TxVxh6h93hrj++dnZH9Sr4Oum2/F+diJtawoHsr7gdgfml2DBsf1gmUeSoeBJPh dKYIEbUiko9gIOPg05R5wuEsRbxd6IqPqwwjIePJ/Cl38z8HGc7rOZYcnCliRqBSyKPb cLcXiwZMRjtJwKWYF3Y8lC1uqymUkJTuE7dwIn3XxQxpMg3oEMh3jngrXwjJUMmLKuYG Z6wzmF5xaQp2b19lUFGQS1Kk+Qir2GjtdARGJnDRkxm6tPqtINufLSw30YNKkDg2zy3d G9vg== X-Gm-Message-State: AOAM533cieYLzUIkfK740jOaucXUul8c3WM8CHLhi8Fol42VdlHAZsUv YvXnXn+0jKKWbbe8yni8yaIlKtwoQvIOI3UKlHs522U4N7qK/snQBxgivdrDgNLyIcSd5ruMTux Jcz/H+FRdf2OendE7DUWi1gu13VDy X-Received: by 2002:a5d:47a3:: with SMTP id 3mr2224937wrb.255.1623407579424; Fri, 11 Jun 2021 03:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf8tRH1WD2BkDk0nh3u9+JxAlR1FoBopNGcMDh/7aHVklUCngEpCzpbjrac9bNu9rkTLOqQw== X-Received: by 2002:a5d:47a3:: with SMTP id 3mr2224904wrb.255.1623407579190; Fri, 11 Jun 2021 03:32:59 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s62sm12741514wms.13.2021.06.11.03.32.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Jun 2021 03:32:58 -0700 (PDT) Subject: Re: [PATCH v7 2/4] KVM: stats: Add fd-based API to read binary stats data 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 References: <20210603211426.790093-1-jingzhangos@google.com> <20210603211426.790093-3-jingzhangos@google.com> From: Paolo Bonzini Message-ID: <2ed4afbf-c5b8-82a5-5fc6-04f00f933761@redhat.com> Date: Fri, 11 Jun 2021 12:32:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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