Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2898013ybd; Mon, 24 Jun 2019 14:58:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIbKz6+308IzzZaqgIet69HfEabl6YwnJnwS27ZmvBFuFU3Os0Su3nE5zihJmUedX08vAO X-Received: by 2002:a63:f00a:: with SMTP id k10mr34482031pgh.193.1561413527490; Mon, 24 Jun 2019 14:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561413527; cv=none; d=google.com; s=arc-20160816; b=cgf23l2w7v1jnSRndQ6SgDbWvkgX/Inuhwfc7ezii1ElgsKi1+M11NWikGA7BAPtho 3cjvP61VKPc7OVViPXYGNA6qvmdzc3kpfdPmFR1YubFlFA8gJUjDysz+byKfRhEIm9+p 8/3Ykewga1P5RqVOo3BJqPTW6UMkrcdkXYeHOZBRg2EnT45NGcGel67vZf2jlXbc3IxO +JIicyeWirzd11qHb8qUjoOQ28ICoN+aiWzq2ZDiO1vZAk2IKURkS3QEjCUyCvBSo38u eakM2pFxj0AB4LQuUuP8yCpUZh2L8wAY+UsqYUI6ry8ECqLrvz3Fz2TYehKCvNonbbvh Ggdg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=REbfb7MBg77FBohqNat0szSbjawgqvqoKEFCXSlmm+s=; b=STZs/BbO+e7AVPHuX/MvsIyiPAoS4EkZs75v6OIRFWrIBk2whwi9QRnrdg8wmVR7J9 +FwZFcM7WUZpLHNT0rwAMPXqiWNj+V37s98qfQp7GM0DAcKrudL+DFYtPj7M+ffdrPEZ 58izVn0ZcTy8UbIJi+EshuNPcMiORSaKhUyYXq/XMIAyI9uVrbnhcdiKD6i2Y2JLPj/Q zZb/D/e1G+gdcbR2LfnJRyPb6LVQA9/VWzVI6EJWww4k35IacQDRJvROsOffp/dK0Ffj IwM3h7Isd2B9SPbAOQaeAsMuIrUp0YFUWDbBINlnBdkha0ObLp4QltGJu8v6aDuqPeo2 JGsA== ARC-Authentication-Results: i=1; mx.google.com; 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 u33si10999552pgn.253.2019.06.24.14.58.32; Mon, 24 Jun 2019 14:58:47 -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; 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 S1730644AbfFXTho (ORCPT + 99 others); Mon, 24 Jun 2019 15:37:44 -0400 Received: from mga01.intel.com ([192.55.52.88]:58846 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729421AbfFXThV (ORCPT ); Mon, 24 Jun 2019 15:37:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jun 2019 12:37:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,413,1557212400"; d="scan'208";a="169538638" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by FMSMGA003.fm.intel.com with ESMTP; 24 Jun 2019 12:37:20 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 566AB302116; Mon, 24 Jun 2019 12:37:20 -0700 (PDT) From: Andi Kleen To: acme@kernel.org Cc: jolsa@kernel.org, kan.liang@intel.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH v1 2/4] perf stat: Don't merge events in the same PMU Date: Mon, 24 Jun 2019 12:37:09 -0700 Message-Id: <20190624193711.35241-3-andi@firstfloor.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624193711.35241-1-andi@firstfloor.org> References: <20190624193711.35241-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen 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) Fixes: 430daf2dc7af ("perf stat: Collapse identically ...") Signed-off-by: Andi Kleen --- 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 a6b9de3e83fc..91d62fd6607f 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -555,7 +555,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