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=-5.3 required=3.0 tests=BAYES_00, 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 7352AC433DB for ; Mon, 8 Mar 2021 16:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DB6865230 for ; Mon, 8 Mar 2021 16:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbhCHQhF (ORCPT ); Mon, 8 Mar 2021 11:37:05 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2656 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbhCHQgw (ORCPT ); Mon, 8 Mar 2021 11:36:52 -0500 Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DvP110dzsz67wcg; Tue, 9 Mar 2021 00:28:53 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 8 Mar 2021 17:36:49 +0100 Received: from [10.210.165.214] (10.210.165.214) 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.2106.2; Mon, 8 Mar 2021 16:36:48 +0000 Subject: Re: [PATCH 1/5] perf metricgroup: Support printing metrics for arm64 To: Jiri Olsa , "will@kernel.org" , "mark.rutland@arm.com" CC: "mathieu.poirier@linaro.org" , "leo.yan@linaro.org" , "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "alexander.shishkin@linux.intel.com" , "namhyung@kernel.org" , "irogers@google.com" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linuxarm , Zhangshaokun , "qiangqing.zhang@nxp.com" , "kjain@linux.ibm.com" References: <1614784938-27080-1-git-send-email-john.garry@huawei.com> <1614784938-27080-2-git-send-email-john.garry@huawei.com> <95205463-4c80-4e8a-a7c0-c2a4e4553838@huawei.com> From: John Garry Message-ID: Date: Mon, 8 Mar 2021 16:34:48 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.165.214] X-ClientProxiedBy: lhreml739-chm.china.huawei.com (10.201.108.189) 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 06/03/2021 19:34, Jiri Olsa wrote: > On Fri, Mar 05, 2021 at 11:06:58AM +0000, John Garry wrote: >> Hi Jirka, >> >>>> - struct pmu_events_map *map = perf_pmu__find_map(NULL); >>>> + struct pmu_events_map *map = find_cpumap(); >>> so this is just for arm at the moment right? >>> >> Yes - but to be more accurate, arm64. >> >> At the moment, from the archs which use pmu-events, only arm64 and nds32 >> have versions of get_cpuid_str() which require a non-NULL pmu argument. >> >> But then apparently nds32 only supports a single CPU, so this issue of >> heterogeneous CPUs should not be a concern there:) >> >>> could we rather make this arch specific code, so we don't need >>> to do the scanning on archs where this is not needed? >>> >>> like marking perf_pmu__find_map as __weak and add arm specific >>> version? >> Well I was thinking that this code should not be in metricgroup.c anyway. >> >> So there is code which is common in current perf_pmu__find_map() for all >> archs. >> >> I could factor that out into a common function, below. Just a bit worried >> about perf_pmu__find_map() and perf_pmu__find_pmu_map() being confused. > right, so perf_pmu__find_map does not take perf_pmu as argument > anymore, so the prefix does not fit, how about pmu_events_map__find ? I think it could be ok. But now I am slightly concerned that we don't put anything like this in arch/arm64, based on this earlier discussion on close topic: https://lore.kernel.org/lkml/20190719075450.xcm4i4a5sfaxlfap@willie-the-truck/ Hi Will, Mark, Do you have any objection to add arm64 specific code here? So what I had originally in this patch was to iterate PMUs in common code and find the CPU PMU and use that to match CPU metrics, as long as it's not a heterogeneous system. Now the suggestion was to move that into arch specific code, as it's not needed for all archs. 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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 1625EC433E0 for ; Mon, 8 Mar 2021 16:38:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 991636522F for ; Mon, 8 Mar 2021 16:38:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 991636522F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d0WqWH87dxd9u/TyPn1oY8vic/1IWucF2ysHdwNQUvQ=; b=K2BSpSe+6JzCfyw2jgv9ZqLET +D/Pswnw05rxvJYzexiOMaV3AmAjs6zMDn0Su9zGv7985G2s2q0sQj+XjeGqtctc6xsj+CWMO4HHw HPNU2r7k34Juhpna0vPqsuRbWwovwA28CcwkHfn9l5jMb2DZkT/fnC1FtrRnfo8XhiyEaIt2/GrT3 dooqJSrcwCBBG9E2a7BlPXsQkXQIlX71RBTbK+90fIXhOras5WOJF8Sufeb5GPTDpOuU92RcscO9L EMFF7yJSG3bdrE81RA7oquUftx+0UAB2QGAUWqX1mJgsKoZy9mAKA8XmKIXbnUJVrECsuCU9C2oRk jQx2xOGkQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJIsM-0015UK-15; Mon, 08 Mar 2021 16:36:58 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJIsG-0015Pz-HX for linux-arm-kernel@lists.infradead.org; Mon, 08 Mar 2021 16:36:55 +0000 Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DvP110dzsz67wcg; Tue, 9 Mar 2021 00:28:53 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 8 Mar 2021 17:36:49 +0100 Received: from [10.210.165.214] (10.210.165.214) 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.2106.2; Mon, 8 Mar 2021 16:36:48 +0000 Subject: Re: [PATCH 1/5] perf metricgroup: Support printing metrics for arm64 To: Jiri Olsa , "will@kernel.org" , "mark.rutland@arm.com" CC: "mathieu.poirier@linaro.org" , "leo.yan@linaro.org" , "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "alexander.shishkin@linux.intel.com" , "namhyung@kernel.org" , "irogers@google.com" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linuxarm , Zhangshaokun , "qiangqing.zhang@nxp.com" , "kjain@linux.ibm.com" References: <1614784938-27080-1-git-send-email-john.garry@huawei.com> <1614784938-27080-2-git-send-email-john.garry@huawei.com> <95205463-4c80-4e8a-a7c0-c2a4e4553838@huawei.com> From: John Garry Message-ID: Date: Mon, 8 Mar 2021 16:34:48 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.210.165.214] X-ClientProxiedBy: lhreml739-chm.china.huawei.com (10.201.108.189) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_163652_768881_EA53427D X-CRM114-Status: GOOD ( 18.58 ) 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 06/03/2021 19:34, Jiri Olsa wrote: > On Fri, Mar 05, 2021 at 11:06:58AM +0000, John Garry wrote: >> Hi Jirka, >> >>>> - struct pmu_events_map *map = perf_pmu__find_map(NULL); >>>> + struct pmu_events_map *map = find_cpumap(); >>> so this is just for arm at the moment right? >>> >> Yes - but to be more accurate, arm64. >> >> At the moment, from the archs which use pmu-events, only arm64 and nds32 >> have versions of get_cpuid_str() which require a non-NULL pmu argument. >> >> But then apparently nds32 only supports a single CPU, so this issue of >> heterogeneous CPUs should not be a concern there:) >> >>> could we rather make this arch specific code, so we don't need >>> to do the scanning on archs where this is not needed? >>> >>> like marking perf_pmu__find_map as __weak and add arm specific >>> version? >> Well I was thinking that this code should not be in metricgroup.c anyway. >> >> So there is code which is common in current perf_pmu__find_map() for all >> archs. >> >> I could factor that out into a common function, below. Just a bit worried >> about perf_pmu__find_map() and perf_pmu__find_pmu_map() being confused. > right, so perf_pmu__find_map does not take perf_pmu as argument > anymore, so the prefix does not fit, how about pmu_events_map__find ? I think it could be ok. But now I am slightly concerned that we don't put anything like this in arch/arm64, based on this earlier discussion on close topic: https://lore.kernel.org/lkml/20190719075450.xcm4i4a5sfaxlfap@willie-the-truck/ Hi Will, Mark, Do you have any objection to add arm64 specific code here? So what I had originally in this patch was to iterate PMUs in common code and find the CPU PMU and use that to match CPU metrics, as long as it's not a heterogeneous system. Now the suggestion was to move that into arch specific code, as it's not needed for all archs. Thanks, John _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel