Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp676411rwb; Thu, 11 Aug 2022 08:08:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Hq1SHawpGlp7zWgiC5BfeRoHpS4npshOX2ARHdFkjT/hfKEqzUwX1fj49hH5vLrgW7+Y/ X-Received: by 2002:a17:907:1c93:b0:730:c9c3:f6f8 with SMTP id nb19-20020a1709071c9300b00730c9c3f6f8mr25299565ejc.17.1660230534864; Thu, 11 Aug 2022 08:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660230534; cv=none; d=google.com; s=arc-20160816; b=Y9qk96E9/EEMydfS4GykSMB/U0mH9Aveei/k6ArkfanufDr4z5r7qWdfssbKIi237b cbQPSjUsE6qwWodP1Mj4O5x5f31KkP60SN4UPww25ceCNWSshy7eOqfeJAbhMp8qXGBc 3lPfhQ0+7MLp3pvBFPOMapIC5eutXDFczsxYyR2r8yxXt83bsctjMQ/5EIF+TC/TNUFj TlURj54Q/K7oR74ssI57PwfqQe3L+Ep9DGE2giFmskzEpKwwTaFtmtLD+jn5kpwWoSSf jv0Ixgc+1b4sapDI7a2kRoLQA/y66EdOHErN5Z6mJ7g3SevpG89jC10sxQgq6jtofJ10 5Cwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=VuxoKNEHDq9bbtUWftq+7l26jgYQnm1KFkpSpKl6oUo=; b=SPG38kTIBLGDol1SRFJnykflxfocHfwr8mj/Erls2iLaMWVIfG8KXWW5TwV2g3Si3+ M3lwjA2hUAM2WinpKwftGEaubNUq2JT5nMLLRY96T+rCIAOhB9ZtO/sBp7HkweUp0mIR 8fKlPSFdaVGhR6Nj0/KEZLeQ6UYh75OspgkNATNxDyUePat7NkmxynBiWOcFMx2Rm8x+ HZZmUKE/dVRra1tf1nM/6lChBlHxn8bE/jpPqyGorJWpFbvjumanrD+bKcnYEAoYkNbX EcC2hGMNjLAyUHd79mxorAkPjgCr2TDyUhWJSGVud/+Q+Ymu8y7ZcOR/Y9XNj9iDoN0Y PASQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw19-20020a1709066a1300b00730d10d8fa8si13494ejc.607.2022.08.11.08.08.14; Thu, 11 Aug 2022 08:08:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234705AbiHKOrm (ORCPT + 99 others); Thu, 11 Aug 2022 10:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229594AbiHKOrh (ORCPT ); Thu, 11 Aug 2022 10:47:37 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FFF56F56C; Thu, 11 Aug 2022 07:47:35 -0700 (PDT) Received: from fraeml741-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4M3V5X2zx7z67tXN; Thu, 11 Aug 2022 22:47:28 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml741-chm.china.huawei.com (10.206.15.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 11 Aug 2022 16:47:33 +0200 Received: from [10.48.150.65] (10.48.150.65) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 11 Aug 2022 15:47:31 +0100 Message-ID: <0dff14dc-0287-71cf-72e8-0c8419c6fb3a@huawei.com> Date: Thu, 11 Aug 2022 15:47:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v4 10/17] perf pmu-events: Hide pmu_events_map To: Ian Rogers CC: Will Deacon , James Clark , "Mike Leach" , Leo Yan , Peter Zijlstra , Ingo Molnar , "Arnaldo Carvalho de Melo" , Mark Rutland , "Alexander Shishkin" , Jiri Olsa , Namhyung Kim , Andi Kleen , "Zhengjun Xing" , Ravi Bangoria , Kan Liang , Adrian Hunter , , , , Stephane Eranian References: <20220804221816.1802790-1-irogers@google.com> <20220804221816.1802790-11-irogers@google.com> <463cffea-51d9-98ad-86ac-d064faac05b9@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.150.65] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/08/2022 15:29, Ian Rogers wrote: >>> _args.output_file.write("""{ >>> @@ -389,6 +409,61 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = { >>> \t}, >>> }; >>> >>> +const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu) >>> +{ >>> + const struct pmu_event *table = NULL; >>> + char *cpuid = perf_pmu__getcpuid(pmu); >> This seems an identical implementation to that in empty-pmu-events.c - >> can we reduce this duplication? Maybe a seperate common c file which can >> be linked in >> >> The indentation seems different also - this version seems to use whitespaces > Agreed. Later on this will change, the empty version isn't compressed > and the jevents.py one is. Having a common C file would defeat the > goal of hiding the API, but ultimately we'd need to get rid of it in > later changes when the empty/compressed implementations diverge. ok, I suppose.. I have to say that this divergence is less then ideal and I don't so like much all the difference in pmu-events/pmu-events.c and pmu-events/empty-pmu-events.c thanks, John