Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10609504ybi; Thu, 25 Jul 2019 02:21:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc9rDrOs3//gPVtOqW8FM+o3W7RwDBwTTSeErW6vdGlMgCWdAONI208vO2v07bkceN0tqu X-Received: by 2002:a63:61cd:: with SMTP id v196mr4392076pgb.210.1564046502732; Thu, 25 Jul 2019 02:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564046502; cv=none; d=google.com; s=arc-20160816; b=xqFdJBgCKaJDM/pcriU8NlC4+S47nntZbkiZgrPQ6eC92ZxgwQXARWv400LWWuyB04 69/oBdYrjUCkqqhyzqKtIBVQS1dMJP1E2ImJsR3DGu5tZ7+3alCl6hokqvbFy8uZIPi6 tncJsJnKSvxxoIJPULMusyH++1Ei9Fxm8SCYTIpirqK8vG2O/7EPnhk02lNfAeBV3I4j 9JsKMATWxKVz6qvudg/t83+5EmrmoeElg8/vkaRCr4kUHHBJshJEoVLdoas1e0AIc1a9 8tDrEueMkMcWPGyfVmca4JJ2Bgf5Iansfb6LAxGar5+f8cC+iKfGE6YDKR1DtVosRex3 2uMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6IrdfTaw5dSGQaS/E2mHNMeJxrGW42+qg9CVZuPBa08=; b=PANYYQXbk/pIrDvb89O4vJNAnbauJ7viK/zAQmEClZj8929o/VHrAayAeL9b5ICDk8 cxFrHpYPGeTlXGSlyOg7XlI4/hHY8PtxHgkqAhaSokhWZr7Q/WV9oH7izOX8S1qbfWIu EZTlnWHKXAqXmGt2zCa8yAulnsmDitDpboQAJ22zWRQVH79ODAhaeYwR6/m28a2BFv9w ZRE5VNFHb2TbbhaBcfkzMXt45EafUWxv1A4844x/wvUZQxDGbnmOCSlxoPOEnDFu3gXa FUkZCKvtTtAJdtU1JFDT4u++sMi+Bjrz6POleWt/eMwSbUMWczLf2JnW03BdFeId6C1o gg7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0b5wYl2W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si16324965pfi.3.2019.07.25.02.21.13; Thu, 25 Jul 2019 02:21:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0b5wYl2W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389563AbfGXU2M (ORCPT + 99 others); Wed, 24 Jul 2019 16:28:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:57950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388328AbfGXTe5 (ORCPT ); Wed, 24 Jul 2019 15:34:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0131422AED; Wed, 24 Jul 2019 19:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996897; bh=Vv7PMWwrHlb6sDO2fUuMs105uz3gcvWzktxHE1gGFdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0b5wYl2WGAMfT22fGP48lpu7amr6779eE10aT1n9klPh8DyrkPsncpdw8uoeY2muF HR11451yniEYKh6bMBaXC2t/mnD//nsdcFg/E3K//O3t2TbVAoqF/IaLj+m3aI4CM9 Z0EdhNcFA4IPaTMVgwbTm/AbibVCKp1eQiq9YKTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Jiri Olsa , Kan Liang , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.2 212/413] perf stat: Dont merge events in the same PMU Date: Wed, 24 Jul 2019 21:18:23 +0200 Message-Id: <20190724191749.688567692@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6c5f4e5cb35b4694dc035d91092d23f596ecd06a ] Event merging is mainly to collapse similar events in lots of different duplicated PMUs. It can break metric displaying. It's possible for two metrics to have the same event, and when the two events happen in a row the second wouldn't be displayed. This would also not show the second metric. To avoid this don't merge events in the same PMU. This makes sense, if we have multiple events in the same PMU there is likely some reason for it (e.g. using multiple groups) and we better not merge them. While in theory it would be possible to construct metrics that have events with the same name in different PMU no current metrics have this problem. This is the fix for perf stat -M UPI,IPC (needs also another bug fix to completely work) Signed-off-by: Andi Kleen Acked-by: Jiri Olsa Cc: Kan Liang Fixes: 430daf2dc7af ("perf stat: Collapse identically named events") Link: http://lkml.kernel.org/r/20190624193711.35241-3-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/stat-display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 4c53bae5644b..94bed4031def 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -542,7 +542,8 @@ static void collect_all_aliases(struct perf_stat_config *config, struct perf_evs alias->scale != counter->scale || alias->cgrp != counter->cgrp || strcmp(alias->unit, counter->unit) || - perf_evsel__is_clock(alias) != perf_evsel__is_clock(counter)) + perf_evsel__is_clock(alias) != perf_evsel__is_clock(counter) || + !strcmp(alias->pmu_name, counter->pmu_name)) break; alias->merged_stat = true; cb(config, alias, data, false); -- 2.20.1