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 748B7C48BE5 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 588D8613E9 for ; Fri, 11 Jun 2021 10:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231196AbhFKKfB (ORCPT ); Fri, 11 Jun 2021 06:35:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41031 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231210AbhFKKfA (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-281-WLqqQoBGNL6rpdjLqnOlqg-1; Fri, 11 Jun 2021 06:33:00 -0400 X-MC-Unique: WLqqQoBGNL6rpdjLqnOlqg-1 Received: by mail-wr1-f70.google.com with SMTP id z3-20020adfdf830000b02901198337bc39so2438629wrl.0 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=joxEeLC3wSy7QXxFLbaYHFOPElTlHzfV5LGF9L8YFEDIHsWvuP5WherNG7Ib/ZIqwE Or4v+JZu1ogHIVUIxN3XP2JN3qFKeBBm7p4WjedJkW+V5yk3w4UUj00SpV3v+1LfaXGT v9EpmT7sEmtjRiHvX8j+pMdwbUxxR/j8E2jULM3tgEa0oCX3R1Z1JS9Wlmft+BnGefGM HvM/MxUCDh/KD6JxRH8EuW+oygy7WI/wXx3ICkOGjjfzYZ3fwbHfDzhCYQRctSFytA3X yXFDHc3jEM1za5nyEKzjGLEyH0YyDEetA7yLQje0SLTmW0qkN1TCDBl8Do/3YJYJRRua WMAA== X-Gm-Message-State: AOAM531yxB22+1pkR7XDy//3ZXbH148EoYJfx0DqkzkZqdtl+MKBLPIG 4H80H1UFJf1u9MdVwSyrDYAhSkp5/DGU9cCDSgn0xgxid8qMU7x6+PENVjJr3jUkJvyNxv7d/9e LS5xVj6P1/+VN1ILXUmrb6Q== X-Received: by 2002:a5d:47a3:: with SMTP id 3mr2224932wrb.255.1623407579423; 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-s390@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