Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2053463pxb; Sun, 16 Jan 2022 08:23:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlzgd6QqWuINVHi16XMW/dcX84YLK9hpWY0zJSYFaQfOMdWS7LC8rOUFjQ1iMISI5dSPwN X-Received: by 2002:a17:902:f24a:b0:14a:bc6c:c327 with SMTP id j10-20020a170902f24a00b0014abc6cc327mr832839plc.24.1642350212447; Sun, 16 Jan 2022 08:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642350212; cv=none; d=google.com; s=arc-20160816; b=pbE6oXw9AJXm2NdM/5V3AXGfBteL98r0XQquOaUYtfZxOBn0juNokpsFth7BxyqHIa MfOS64Nx/T7gGYKWAr4c/P8bfVQVTBSwrNn7oPClKPGqeuZ38MMdyNbOvsdjPamyFKni 3ljyDJveZWI+yX2ndU06fG+bwxol+LdoXtbM67hQ4skRBbWLs7r3YI8pW6Qi5yCesEEW 2VgO/W+w6iLV2aJe5CWIPc3Lij4JClkE7CdKSraLGBerMWRjc8jC9NVTkTDd3DEK0caL xx+CccFHFELO/ulAzE3N313HGiJMmmoTsAWOn8fUpO7dGUd7lBaFYGT7dACAHs/AD/XZ xEdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JBwfTQjArE6eLk/4uHSeK0zXi4PJEQ1vDrNBzc/CsDg=; b=F1whkP8wfhuACjADlfom739ojU//IFcJwfu2Zpkp6+GKSqG0eusC35uB7B6XNZbWxz AMc+sC8NtgLnKZ2uTim2aDYw1SGBt4KCYggfN4chotUKq/eNj2Jai+DDdAVAXFEF+UbI 71HXBjyTkUyok0KWVm9vDNUGkQE/DsFhUGv9x3/iWbnREepFllBYlV/qIZww3aTbrUTl dtw6EaWdAPBdND1myvS5yvSGHw2W/dm2z5jWNUq38o/qmOdInS4ftwBk0tHBHZ4e4CCT 2Eqxu0E7qRTSU0THSaf1v9wD+RjD/YFyWcRTN4bcjD1Zh6Js7lfRlEfB88oni3uAXiWj bUDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cZquKnK2; 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 o14si11139708pjp.152.2022.01.16.08.23.20; Sun, 16 Jan 2022 08:23:32 -0800 (PST) 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=k20201202 header.b=cZquKnK2; 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 S232218AbiAOUHm (ORCPT + 99 others); Sat, 15 Jan 2022 15:07:42 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:42064 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbiAOUHl (ORCPT ); Sat, 15 Jan 2022 15:07:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EB62BB80B22; Sat, 15 Jan 2022 20:07:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CCF0C36AE7; Sat, 15 Jan 2022 20:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642277258; bh=9eB2RbmltV02P15qASAJG5h7XFKhpTtPFKJhPLs5SqE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cZquKnK2G9J45YyrOAoO2CMvllV39jB7BmKDD4Ar2bocj4UGS06haAFqhqvlAVbun 0impTEGqa9tYZXe9r4rQrWG+Jfdtq8qVe3p+m4sgmjJVBfLFx4X5o1f91e/cJaOBHW OOwGCpAIw58WTJ/G/0y5tNL3hlNA9kLnLvdV3GJkQkSFtL6j2Oytqg8L0/gA+bCCSv CgLDUyvr/Wbxc2NkYNjUs4/1yl7DpOo4e89G3gSM36JxNiseFWAEZKUE7OjxS37kXg AN+dSxyqZjT1keYRWEDjZuAVH5GO1twJmrhK1xdQlJ12u0njbsn6bsFymtDjh3jv8c cmWrMXpp3XqWw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 42B7940714; Sat, 15 Jan 2022 17:07:35 -0300 (-03) Date: Sat, 15 Jan 2022 17:07:35 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andi Kleen , John Garry , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, eranian@google.com Subject: Re: [PATCH] perf metric: Fix metric_leader Message-ID: References: <20220115062852.1959424-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220115062852.1959424-1-irogers@google.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jan 14, 2022 at 10:28:52PM -0800, Ian Rogers escreveu: > Multiple events may have a metric_leader to aggregate into. This happens > for uncore events where, for example, uncore_imc is expanded into > uncore_imc_0, uncore_imc_1, etc. Such events all have the same metric_id > and should aggregate into the first event. The change introducing > metric_ids had a bug where the metric_id was compared to itself, > creating an always true condition. Correct this by comparing the > event in the metric_evlist and the metric_leader. Thanks, applied. - Arnaldo > Fixes: ec5c5b3d2c21 ("perf metric: Encode and use metric-id as qualifier") > Signed-off-by: Ian Rogers > --- > tools/perf/util/metricgroup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c > index 51c99cb08abf..1f1b78b0388f 100644 > --- a/tools/perf/util/metricgroup.c > +++ b/tools/perf/util/metricgroup.c > @@ -314,7 +314,7 @@ static int setup_metric_events(struct hashmap *ids, > */ > metric_id = evsel__metric_id(ev); > evlist__for_each_entry_continue(metric_evlist, ev) { > - if (!strcmp(evsel__metric_id(metric_events[i]), metric_id)) > + if (!strcmp(evsel__metric_id(ev), metric_id)) > ev->metric_leader = metric_events[i]; > } > } > -- > 2.34.1.703.g22d0c6ccf7-goog -- - Arnaldo