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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABC5EC19F2A for ; Thu, 11 Aug 2022 14:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234713AbiHKOrn (ORCPT ); Thu, 11 Aug 2022 10:47:43 -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 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