Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07A50C433EF for ; Wed, 8 Dec 2021 12:06:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232922AbhLHMJo (ORCPT ); Wed, 8 Dec 2021 07:09:44 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4230 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbhLHMJn (ORCPT ); Wed, 8 Dec 2021 07:09:43 -0500 Received: from fraeml714-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4J8G7c27GDz67b2S; Wed, 8 Dec 2021 20:05:00 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml714-chm.china.huawei.com (10.206.15.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 8 Dec 2021 13:06:09 +0100 Received: from [10.47.91.245] (10.47.91.245) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 8 Dec 2021 12:06:08 +0000 Subject: Re: [PATCH 01/22] libperf: Add comments to perf_cpu_map. To: Ian Rogers , Andi Kleen , "Jiri Olsa" , Namhyung Kim , Kajol Jain , "Paul A . Clarke" , "Arnaldo Carvalho de Melo" , Riccardo Mancini , Kan Liang , Peter Zijlstra , "Ingo Molnar" , Mark Rutland , "Alexander Shishkin" , , , "Vineet Singh" , James Clark , "Mathieu Poirier" , Suzuki K Poulose , Mike Leach , Leo Yan , , CC: References: <20211208024607.1784932-1-irogers@google.com> <20211208024607.1784932-2-irogers@google.com> From: John Garry Message-ID: Date: Wed, 8 Dec 2021 12:05:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20211208024607.1784932-2-irogers@google.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.91.245] X-ClientProxiedBy: lhreml724-chm.china.huawei.com (10.201.108.75) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/12/2021 02:45, Ian Rogers wrote: > diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h > index 840d4032587b..1c1726f4a04e 100644 > --- a/tools/lib/perf/include/internal/cpumap.h > +++ b/tools/lib/perf/include/internal/cpumap.h > @@ -4,9 +4,16 @@ > > #include > > +/** > + * A sized, reference counted, sorted array of integers representing CPU > + * numbers. This is commonly used to capture which CPUs a PMU is associated > + * with. > + */ > struct perf_cpu_map { > refcount_t refcnt; > + /** Length of the map array. */ > int nr; > + /** The CPU values. */ > int map[]; would simply more distinct names for the variables help instead of or in addition to comments? Generally developers don't always check comments where the struct is defined when the meaning could be judged intuitively Thanks, John