Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1441833ybh; Thu, 23 Jul 2020 09:01:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTwTDamBVMBrYQByinS+6/Vus5cpf8Tp2GXk/VIpqD4op4eeC079YrqNq88ZO/T2JKsYEM X-Received: by 2002:a17:906:fb99:: with SMTP id lr25mr5026538ejb.49.1595520074006; Thu, 23 Jul 2020 09:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595520074; cv=none; d=google.com; s=arc-20160816; b=SLW07I2hhiJi0Xwuf6PhUuf+n9m5eYeSKSB/+4znBTP51Vmnh1pJ7HURw8Jr+mDpZh yZw2Qj8w3ZJ6m9XbUoftdpJ2iygob9CbU2Cg/OPmOrnVIFlDMbj4OkH6EkJaNTrepGs1 reDBw4QHaqon/Y3K+g3W+NWLfOLArfatvCxVUzwExxPuMr0sy6uNDKj5VDFurvcbIxJe VoisOUulJyvKwQ8r9VGGMoXeXqb8+psohd24SdKhbyVj2UCPIhcWrGHq+nnED90nHUFx jTlfBvZFxu6Y6JOYQDJEZjoCyRAMONQZ0s0dbEeXTVoIzsejMqBSeH8BWImvYgZh2pkO EHEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:cc:to:from :date; bh=Z4jcPa7FnkfCyM1VI59ji8R/0X3cF386m6rJn7R6GbY=; b=xQyGdvZPRbrbqKecVj6l8DGWXXBGsCMhqZ3k0WqQJfCdUCGBqevbOTkhX817uwU3vD iJ2ARopZon0KkP7mNUW7YH6NxnufU8lJ52oiPA1rUbdrN1QRPgZMh/og01lNx4XIlYuH G2C45OxVSz595LqP4Q+1uDJCQgLmPBIv7XXKWmasi90P9U+E3tcE118vaodbbjKzNkEM 09PxwhmcUJKoIpg2fR2yd1Jzg5ffpdQDGwtBl8OMiXNtwxCGk2fWy4KzEZJP1oN+qoNQ AMa+SUmmZLGyj29ndsZtvqjvPzSwCbDEhWmXNLsQ4UFYtjz5W5VRDSLiudBVzD5q1JuK jR2A== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt3si2877644ejc.325.2020.07.23.09.00.43; Thu, 23 Jul 2020 09:01:13 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728791AbgGWQA1 (ORCPT + 99 others); Thu, 23 Jul 2020 12:00:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44162 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728134AbgGWQA1 (ORCPT ); Thu, 23 Jul 2020 12:00:27 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06NFWKh9038374; Thu, 23 Jul 2020 12:00:06 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32fb9b5ps2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jul 2020 12:00:05 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06NFX31D041579; Thu, 23 Jul 2020 12:00:05 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 32fb9b5prj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jul 2020 12:00:05 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06NFt9JZ018599; Thu, 23 Jul 2020 16:00:04 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma03wdc.us.ibm.com with ESMTP id 32brq9nk9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jul 2020 16:00:04 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06NG005H50069810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jul 2020 16:00:00 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 10A2D6E060; Thu, 23 Jul 2020 16:00:03 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A5BD6E054; Thu, 23 Jul 2020 16:00:01 +0000 (GMT) Received: from li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com (unknown [9.65.235.84]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 23 Jul 2020 16:00:00 +0000 (GMT) Date: Thu, 23 Jul 2020 10:59:58 -0500 From: "Paul A. Clarke" To: Jiri Olsa Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Andi Kleen , Kajol Jain , John Garry , Stephane Eranian , Ian Rogers Message-ID: <20200723155958.GA7141@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> References: <20200719181320.785305-1-jolsa@kernel.org> <20200721143702.GA15990@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> <20200722181158.GF981884@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722181158.GF981884@krava> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 Subject: RE: [PATCHv3 00/19] perf metric: Add support to reuse metric X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-23_08:2020-07-23,2020-07-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007230113 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2020 at 08:11:58PM +0200, Jiri Olsa wrote: > On Tue, Jul 21, 2020 at 09:48:48AM -0500, Paul A. Clarke wrote: > > On Sun, Jul 19, 2020 at 08:13:01PM +0200, Jiri Olsa wrote: > > > hi, > > > this patchset is adding the support to reused metric in > > > another metric. > > > > > > For example, to define IPC by using CPI with change like: > > > > > > { > > > "BriefDescription": "Instructions Per Cycle (per Logical Processor)", > > > - "MetricExpr": "INST_RETIRED.ANY / CPU_CLK_UNHALTED.THREAD", > > > + "MetricExpr": "1/CPI", > > > "MetricGroup": "TopDownL1", > > > "MetricName": "IPC" > > > }, > > > > > > I won't be able to find all the possible places we could > > > use this at, so I wonder you guys (who was asking for this) > > > would try it and come up with comments if there's something > > > missing or we could already use it at some places. > > > > > > It's based on Arnaldo's tmp.perf/core. > > > > > > v3 changes: > > > - added some acks > > > - some patches got merged > > > - added missing zalloc include [John Garry] > > > - added ids array outside the egroup object [Ian] > > > - removed wrong m->has_constraint assignment [Ian] > > > - renamed 'list' to 'metric_list' [Ian] > > > - fixed group metric and added test for it [Paul A. Clarke] > > > - fixed memory leak [Arnaldo] > > > - using lowercase keys for metrics in hashmap, because jevents > > > converts metric_expr to lowercase > > > > > > Also available in here: > > > git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git > > > perf/metric > > > > These changes seem to be mostly working for me. > > > > I attempted to exploit the new capability in the metrics definitions in > > tools/perf/pmu-events/arch/powerpc/power9/metrics.json. Those changes > > are included below. > > > > The one problem I found is with the "cpi_breakdown" metric group, as it > > no longer works: > > ``` > > # perf stat --metrics cpi_breakdown ./command > > Cannot find metric or group `cpi_breakdown' > > ``` > > > > "cpi_breakdown" does show up in `perf list --metricgroup`, and all of the > > (95!) metrics listed in that group are usable, so it's not obvious whether > > my changes have a problem, or merely provoke one. > > I underestimated the recursion depth setup for groups, > your change is working for me with following change: > > -#define RECURSION_ID_MAX 100 > +#define RECURSION_ID_MAX 1000 That indeed addressed the issue. Is there a point where that limit was being hit and the code silently fails? If so, should that failure be less silent? PC