Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1099011pxu; Thu, 8 Oct 2020 03:21:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmqjYvC/o5i+dTE4kIdwkMgCDMMwNDAFnuSbE+AjkYRtQ9DVM7UYruqE2VgU/5Jh4Gsjgq X-Received: by 2002:a50:a452:: with SMTP id v18mr7964960edb.143.1602152515253; Thu, 08 Oct 2020 03:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602152515; cv=none; d=google.com; s=arc-20160816; b=SfH3YcdBSm6PLuG4oeWMUCyJkt5nmHU71BihbG+oIfcVF3x3eu8C4ak2sFehQETlTz emdYIv2Js5tVH5CeUNM9U0pMBWOSdxnnrSuFG9j/H58zLJL7vGszPL1nNaiGtZqHY6pe WJ3H9OfEg8RGccxRukTA6DyaubUOCf7kN89hdklppvJKInAtM3164jIRv7qlzmO0ONTa v5N6a0LwzobrY278PY9/Yh5SofIsaYkxXt0Q/gZPExMZV3zf3PaRtqvssbZfKzThOXMP JHe8GqM7/acOSXRVZxz/Q2nB6pdgxtrFyuiqRjS+unAOAswU2S55uI3opvBpOZljeYcb zQIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=foUNIOo9b0X17XTAL4A4TWb1EmNy2gxrLb1WoqH+A9g=; b=o1CHvnhKwZpmxzNq2gHJJLt7RSYMiGYdc12MBokjy8uW+qoXa1LrC+UDPp5JRdFTff dTm4Wsx8rIsBn09ovguCMGB0AsLhpsHtncCMlSjy6O9c57pgePVSJ8W8z2NsLPyF+jsb M2ONt9le7L466uIUWoO7KAsxd2FFb8TmRtgT5f2REX2qCIe5A+yQ05hhESPMQT6Ek3Kv c95XhKJ1Vm/PaTWe3ncVoLSq0K9ebAXMV8P0J+x1wZD8RvqH24wRpEpL6aVEbTLGuG+L nqG7DHw3qcMYVtvtOD9/i3fZ7iyvGiZ8uFiegtQg29qXzv5OFM6IHheVEjsSqOqIrSxM 4M3A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si3100053edy.394.2020.10.08.03.21.32; Thu, 08 Oct 2020 03:21:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729478AbgJHKTc (ORCPT + 99 others); Thu, 8 Oct 2020 06:19:32 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:49734 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729429AbgJHKTS (ORCPT ); Thu, 8 Oct 2020 06:19:18 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 85115EC064D8AB59D417; Thu, 8 Oct 2020 18:19:10 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Thu, 8 Oct 2020 18:19:01 +0800 From: John Garry To: , , , , , , , , , , CC: , , , , , , , John Garry Subject: [PATCH RFC v4 09/13] perf metricgroup: Hack a fix for aliases when covering multiple PMUs Date: Thu, 8 Oct 2020 18:15:17 +0800 Message-ID: <1602152121-240367-10-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1602152121-240367-1-git-send-email-john.garry@huawei.com> References: <1602152121-240367-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function find_evsel_group() seems broken for aliases covering multiple PMUs, as dicussed at: https://lore.kernel.org/lkml/CAP-5=fUy6FOszNRwJF6ZNpqQSSyrnLPV6GbkEcZMqAhUp3X0ZA@mail.gmail.com/ For now, hack a fix which I only know works for me. Signed-off-by: John Garry --- tools/perf/util/metricgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index d948a7f910cf..82ba3638f48c 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -213,7 +213,7 @@ static struct evsel *find_evsel_group(struct evlist *perf_evlist, /* Ignore event if already used and merging is disabled. */ if (metric_no_merge && test_bit(ev->idx, evlist_used)) continue; - if (!has_constraint && ev->leader != current_leader) { + if (!has_constraint && (!current_leader || strcmp(current_leader->name, ev->leader->name))) { /* * Start of a new group, discard the whole match and * start again. @@ -279,7 +279,7 @@ static struct evsel *find_evsel_group(struct evlist *perf_evlist, * when then group is left. */ if (!has_constraint && - ev->leader != metric_events[i]->leader) + strcmp(ev->leader->name, metric_events[i]->leader->name)) break; if (!strcmp(metric_events[i]->name, ev->name)) { set_bit(ev->idx, evlist_used); -- 2.26.2