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 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEA94C25B07 for ; Thu, 11 Aug 2022 14:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Eme3iakh0LETJMqoVU9Pu3oQOwHU0wjMwkwEgcpBIcg=; b=pe4FP+TJ6Qn1OC DHcLI5WnCzZsdpbqhuFkD4PCJFb44Hc28gAwnfuFWJrYy7pYvp/4umTR3DIkCFBO50Ya69rqTXasA azbGlK91MBDeonhUxvKmtTpE8rEn9Onhl5oLt98S8N++FzQEaXfLJNUnUJhGrjghlUkLt3D1szjK7 SDXoW/vcHEU2jBGVgLyzvBRRn/59P2rtmIa+jQvf2hP6eCgr/CnA0NlazIbLamsheFygTx0qjN0FJ SpWgsdreE4aR9aqEUegfjNoyzI60CugeE30SaCaMG1wWZS3IiebeLDIPCGOMR4U6iI8YNmHXlbAir OVnClgVYAQzkklpSuPPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM9TU-00DTbB-GY; Thu, 11 Aug 2022 14:47:53 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM9TH-00DTQW-Or for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 14:47:42 +0000 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: 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220811_074740_004016_F47E44E7 X-CRM114-Status: GOOD ( 10.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel