Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3355234pxf; Mon, 22 Mar 2021 04:41:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHyn61ATDJ4DWCtmyON9VnbXhgfAlY+AX8ekXsT7uU3Z2YK6U8/TX+zRv/6GxFLC+uWEQc X-Received: by 2002:a05:6402:1103:: with SMTP id u3mr24830642edv.205.1616413264096; Mon, 22 Mar 2021 04:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616413264; cv=none; d=google.com; s=arc-20160816; b=DWJB/mneo0XoEG3mzpVDLqc0lF7E/nZ/3xldWcYvZVKXtA85I/VcfCKUCcQPrLno9n ao90yRqD0c5JeNcmqOzkKy66Wqh/KEy6SsU7ai741WcCcSk4WO0+fNpgVEhYqff9upnK vZi+025sRAPZTXhFVsciDJS95BEfSZythODoO+Uo1fqRUAqMLScSqPr4fQ3ZHWgHL0Yp xGzB6WT0tYqoTp6cZ/1+jbTekcfl+NEBqiXtwGiZU2Dofbnkdj8xis70Z78dNjPcKfEW TE3c0cUVFNQbtOPU8VlHsKQCqi9m3ABNbPV74pE6+GEk8SUF/UMhwIE3iJVtOUHjAiWC 7rWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Nzd7pX37o5ZOjyZVlHBGbvuZusM2q9rjYjo6yBD7boE=; b=u5qi9vXD4fV2tKS0Kh1pF+OdltRjMtqxgq+C6Dxj9xieftju/WSwIshcT7pxT4jbfs Ocl/DMcNtDGXimn/Tow1mcN8r/PruJjROikg6K3MUiXGCzNLudmoTkcLz63lAllVGeca p/cMrdtwZVKfCKm2BDu3xiRVI1TGdeXqf8qTHpLhZx2ieFMod/SKI1FxcAU7Di9FtAc5 rEYysy2Qil9zcnQBwZxeSYmDUoXV34bzkD/8lw/RWDOUy2RiSgNgBnjR6l/ADo6Mxfut /i2X2rClDUQxfctmbVETuJTxR5166xXJOgFRvFMgw4uFXXtYkrCMB/IrN2qpucX5mwk+ uKuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si11399570ejz.565.2021.03.22.04.40.41; Mon, 22 Mar 2021 04:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229979AbhCVLjS (ORCPT + 99 others); Mon, 22 Mar 2021 07:39:18 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:2723 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbhCVLis (ORCPT ); Mon, 22 Mar 2021 07:38:48 -0400 Received: from fraeml734-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4F3sjd6Btyz681SN; Mon, 22 Mar 2021 19:29:57 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml734-chm.china.huawei.com (10.206.15.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 22 Mar 2021 12:38:38 +0100 Received: from [10.210.167.192] (10.210.167.192) 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, 22 Mar 2021 11:38:36 +0000 Subject: Re: [PATCHv4 00/19] perf metric: Add support to reuse metric To: "Paul A. Clarke" , Jiri Olsa CC: Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Andi Kleen , Kajol Jain , Stephane Eranian , Ian Rogers References: <20200729091908.1378911-1-jolsa@kernel.org> <20200801114050.GB377079@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> From: John Garry Message-ID: <7682e4c3-5840-bb6d-5e76-6b3fd37b04c0@huawei.com> Date: Mon, 22 Mar 2021 11:36:23 +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: <20200801114050.GB377079@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.167.192] X-ClientProxiedBy: lhreml718-chm.china.huawei.com (10.201.108.69) 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 01/08/2020 12:40, Paul A. Clarke wrote: >> v4 changes: >> - removed acks from patch because it changed a bit >> with the last fixes: >> perf metric: Collect referenced metrics in struct metric_ref_node >> - fixed runtime metrics [Kajol Jain] >> - increased recursion depth [Paul A. Clarke] >> - changed patches due to dependencies: >> perf metric: Collect referenced metrics in struct metric_ref_node >> perf metric: Add recursion check when processing nested metrics >> perf metric: Rename struct egroup to metric >> perf metric: Rename group_list to metric_list >> >> Also available in here: >> git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git >> perf/metric > I built and ran from the above git branch, and things seem to work. > Indeed, I was able to apply my changes to exploit the new capabilities > via modifications to tools/perf/pmu-events/arch/powerpc/power9/metrics.json, > as I posted earlier (and will submit once this set gets merged). > Hi Paul, I was just wondering: Does perf subtest 10.3 work ok for you with the metric reuse? That's "Parsing of PMU event table metrics" subtest. Hi Jirka, If I add something like this: { "BriefDescription": "dummy test1", "MetricExpr": "Bad_Speculation + Frontend_Bound", "MetricGroup": "TopdownL1", "MetricName": "dummytest", "PublicDescription": "dummy test2" }, I get "Parse event failed metric 'dummytest' id 'bad_speculation' expr 'bad_speculation + frontend_bound'" Thanks, john > Tested-by: Paul A. Clarke > > One thing I noted, but which also occurs without these patches, is that > the perf metrics are not computed unless run as root: > -- > $ perf stat --metrics br_misprediction_percent command > > Performance counter stats for 'command': > > 1,823,530,051 pm_br_pred:u > 2,662,705 pm_br_mpred_cmpl:u > > $ /usr/bin/sudo perf stat --metrics br_misprediction_percent command > > Performance counter stats for 'command': > > 1,824,655,269 pm_br_pred # 0.09 br_misprediction_percent > 1,654,466 pm_br_mpred_cmpl > --