Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1350863ybt; Sat, 27 Jun 2020 05:51:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzv8t1e2PIGvY+XpAGGcfRxXxA/pdUbNDPugwFH/FH8JPEJ5ptjwnqsWXqPferG6dT12qX X-Received: by 2002:a17:906:18e1:: with SMTP id e1mr6627738ejf.200.1593262318720; Sat, 27 Jun 2020 05:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593262318; cv=none; d=google.com; s=arc-20160816; b=zDWtYlSozBYW6qVebbJuq4CdLwG9OXOxS0XEZ265HGG0jy53WmpdkK7T+5PeO0/4SN FZgsHw8MSbnT3bG6rxg1j4VcecqU2PrkVUr337/392BFJn0XTW5pK2vKVNwi3zcm0BM/ TIl/IDV6JsMeX063X/Uijur2fFX5QbQ3wSQLIjlnUoJwc9Q1v3jEI1jl5qdd6yiu9q6s zO2b2945z4lxhrB8uEtmmjKao7GhZlozsA1IWDO8fhZXAufsfQawYTEqas2LSNhezONp EVqGS0wI2EjoMA7byYu4Y6wRDhWfbUsQhUXflNcT24ySq+y8MAdtcl4GLZ5nEvma2Dhb XeJQ== 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=npZu00EqtjjHhhLbNHM54uplSnD3S/cKOTJ2mxbwLW4=; b=0rjABTp822qg5WfgniX+tth5KuTiaf0uw4q5BfqCNY1z509xIgUD6NUpfKJLOEqtOe 1Z8Y1WOF8Qa2NHbPyFgfM/0OdwOKM97BecZat5HmYjyQeM/Yv1kB1Hz+kPsFqdDuaUKj zhgaWLxmFmM4ttLTYpwAGpL60pNl7DoHCevfeFjfsiwLqY6Pv/1KAP6FNpITxP6ByzwG RRACrjtIJC3gFzh49wNwMjnC9vLeYtW1s+z/r101dc8aCloGxxP9Hb/oUjoakl3DEN/Q seUIFqvJZk2ZFTahmZJM0B8k+Ziqyec8MqYWY7RKZ/2KXnPGFduMR56TEd04CVYpilKA 6tJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X2zI4gF8; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si2188599ejx.94.2020.06.27.05.51.36; Sat, 27 Jun 2020 05:51:58 -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=@kernel.org header.s=default header.b=X2zI4gF8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbgF0Mqx (ORCPT + 99 others); Sat, 27 Jun 2020 08:46:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbgF0Mqx (ORCPT ); Sat, 27 Jun 2020 08:46:53 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 278E921548; Sat, 27 Jun 2020 12:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593262012; bh=npZu00EqtjjHhhLbNHM54uplSnD3S/cKOTJ2mxbwLW4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X2zI4gF8mRDVjiriIxbXqLIKwNC6A9/bN79lgc8sBtWt3OchkS8pEr5gPhTMxWCV2 kJW/FK6SjLTcl/p3xtJ9GdWab2EPwh5l8jZwoM6x3UHuamWSJUJDR4/Y7bwE2h6Euv SDqFcfUWavXTZ4RlD57eh7nVLr+8yWak2w59uSqo= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 46CB0405FF; Sat, 27 Jun 2020 09:46:50 -0300 (-03) Date: Sat, 27 Jun 2020 09:46:50 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Andi Kleen , Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Kajol Jain , John Garry , "Paul A. Clarke" , Stephane Eranian Subject: Re: [RFC 00/10] perf tools: Add support to reuse metric Message-ID: <20200627124650.GE29008@kernel.org> References: <20200626194720.2915044-1-jolsa@kernel.org> <20200626212522.GF818054@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jun 26, 2020 at 02:44:14PM -0700, Ian Rogers escreveu: > On Fri, Jun 26, 2020 at 2:25 PM Andi Kleen wrote: > > On Fri, Jun 26, 2020 at 09:47:10PM +0200, Jiri Olsa wrote: > > > this patchset is adding the support to reused metric in another > > > metric. The metric needs to be referenced by 'metric:' prefix. > > Why is the prefix needed? > > Could just look it up without prefix. > The name could be a metric or an event, the logic for each is quite > different. You could look up an event and when it fails assume it was > a metric, but I like the simplicity of this approach. Maybe this > change could be adopted more widely with something like "perf stat -e > metric:IPC -a -I 1000" rather than the current "perf stat -M IPC -a -I > 1000". Humm, the more concise, the better, so I think that we should use metric: when we notice ambiguity, i.e. we should first lookup the provided name as an event, and even if it resolves, look it up as well as a metric, if both lookups work, then one need to disambiguate. But then, why should we pick a name for a metric that is also a name for an event? Can you think about a concrete case? Can't we detect this at build time, when introducing the new metric and bail out? - Arnaldo