Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2892523ybh; Sat, 25 Jul 2020 04:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw06p/5Q4fJ8QFsfJ8GWO4lxShka319tqWfBhxcxwZ3f5EGvz2nCMoX5CkfvQGQTfYADnmo X-Received: by 2002:a17:906:fcc1:: with SMTP id qx1mr13638930ejb.379.1595678162451; Sat, 25 Jul 2020 04:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595678162; cv=none; d=google.com; s=arc-20160816; b=kdbXsEMIjW2S2G3cb5Ox61uZvQRRfAuC1CiBBAwZQTk1dFkj3OTAJLUkbgeePmCzx5 d0NI+D6Pyi3skzwMqooIQgIRgzs8erZ/M0Fm+VfhgCgCdP9wGEozISYs78aBCxdmZ8t7 xFtAfebLKo5aDV5Lb9PhZFw9bP1H5By47L4H7gdjaGTP2lBAcjD7jOVJBpn1IHJmueA9 ut+8UcNZo3rObAWH0ExPZNXQOKjYzuKKOvJblxoVmXyqPGswlW5xb2ixyaKHF9zINFjE g63qJZPx5n4Dlq/YcYe8iNwPcqmdYwrdAys4/Y4p8AGC1Sc6PAX+a3mJd6Hxgwb+4nJi 95HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L6ENQOqyGlC8PQc4e8arGaizO9xFQPQojXBpmwr8+qU=; b=ZCZ6Y53jGy7h7KygRHQkG/dqn18uwiqXd+wtma10V6C+OLrxrojlbu8yVDAa+SDc/n ZmugQuy7LHRnM54gBXXhMUj2EzsUa2ErvGxyUUPiXqvSeiNVfg57KapT+bZig22gJtuE DrqTkmBe/Ycm39u8xak7IE8svAjPcPIBWlqOjuS72pjJvoOVynq4tNuFrYNqxxtB32X4 zr1a3pAWuUFrfl6ODgcw7p3g06KmrmOaOz0GOw2ZWcbehzCd8+bPZ897ZMPjZUoFr6Hs rTiZ3lSUYlxJJv0nzmDfSi2kihK6F1Z1lqjn4OalYNBme43Oj9jUnViH76YLsaZ3/ya2 X8lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EuaZTioi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si2193602edv.199.2020.07.25.04.55.39; Sat, 25 Jul 2020 04:56:02 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EuaZTioi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbgGYLw7 (ORCPT + 99 others); Sat, 25 Jul 2020 07:52:59 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:52231 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726583AbgGYLw7 (ORCPT ); Sat, 25 Jul 2020 07:52:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595677977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L6ENQOqyGlC8PQc4e8arGaizO9xFQPQojXBpmwr8+qU=; b=EuaZTioijSh1SZkNnHGUM5FnKMQLu/Fg8e0+XFtbfM9Pdax/kfigA2O1Ga1aBdVBus8cff kqUlOq3RTKwNVFtQh8Fs+koZaa/omZSk831MSqg0Jd5YgCDtxoqETrNkJfNfdWkyXyTQan qi09MqRszGhaJrXz1nPewdpN6z6Yg8Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-410-fc95pyLQMqKRsKJQUxY9Dg-1; Sat, 25 Jul 2020 07:52:55 -0400 X-MC-Unique: fc95pyLQMqKRsKJQUxY9Dg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60FE980183C; Sat, 25 Jul 2020 11:52:53 +0000 (UTC) Received: from krava (unknown [10.40.192.11]) by smtp.corp.redhat.com (Postfix) with SMTP id D634960BF3; Sat, 25 Jul 2020 11:52:49 +0000 (UTC) Date: Sat, 25 Jul 2020 13:52:48 +0200 From: Jiri Olsa To: "Paul A. Clarke" 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 Subject: Re: [PATCHv3 00/19] perf metric: Add support to reuse metric Message-ID: <20200725115248.GB1157288@krava> References: <20200719181320.785305-1-jolsa@kernel.org> <20200721143702.GA15990@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> <20200722181158.GF981884@krava> <20200723155958.GA7141@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200723155958.GA7141@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 23, 2020 at 10:59:58AM -0500, Paul A. Clarke wrote: > 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? yes > If so, should that failure be less silent? I'll make it more verbose thanks, jirka