Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6718741pxv; Fri, 30 Jul 2021 00:09:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0G9LCrrHupu9mjzvhWyqZrTxa0DMqXrjUjpz1vccwKH6lvbLjJWOhCKrRECi0fYbDn3B/ X-Received: by 2002:a02:6f1c:: with SMTP id x28mr987684jab.95.1627628983000; Fri, 30 Jul 2021 00:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627628982; cv=none; d=google.com; s=arc-20160816; b=dxTG1NgIz2UAZhF7t39Akomf94IPj3R/JRLlFWJU4zkyrHVvgMOEv2OIsASbFKhvIB Xm6U0VKqodrciVcJ3AQMumJNR5G3hDBmg+P/Fj/B4Js8BiDzT1yIc/TIBYOyLZ/hXfou wJ4aCUYg4AD7yN5bQHI9BQBVFpOlc/fUlorpBX6RPD4GayuIveujqKuq79L18UW5fBEJ EivbQkitq2XqbGtuAVmY0g0+KK5NlSG+n0R/7HNax+GvDZHCT5SDBtlw9nReP75cexXL zjnTwGoNn64zCQUsg45Z60zep0DXFHLZHMXGJao1qfM8tkxgNKSSsGg5lCWrBQVWSROC b2dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=JE27AVaBBpEh99WSIfb8SYY/a/wBFa6yLTDtI7O4+bs=; b=dFuINKC0ZwNUc/makHmVszcJ1UXmI6t/Y/hpb24VKFn812FUBY53IYXcJ6JPTsreyt 6DLFvBCJNgQWhRkarlFmIs2fdGTg8JeMU9TyTWtTj7dCtELa3vdZ7+YIhS3tNRV1Wazv l69qSiynBa5cOcOTjA+PkSIAAs9St8ZPbp94dsVs8SeLFPLQEcqjhEJINn/aFfmzNNr2 Y/utAvvNPHchcqhF+HL6oq1DFuDZVEEAWXVYO5I7JauRjFOcXeuu6HFfNWE/kmbRVyG5 Io9JkJce83EYWiyJ1pe8g1SVbDrW/dY4swdBbTd27dmH9x6OiKy8gw1JPlKm3c29PWpg yRrQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si954104iom.57.2021.07.30.00.09.31; Fri, 30 Jul 2021 00:09:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237452AbhG3HIu (ORCPT + 99 others); Fri, 30 Jul 2021 03:08:50 -0400 Received: from mga17.intel.com ([192.55.52.151]:47755 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230226AbhG3HIt (ORCPT ); Fri, 30 Jul 2021 03:08:49 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10060"; a="193323604" X-IronPort-AV: E=Sophos;i="5.84,281,1620716400"; d="scan'208";a="193323604" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2021 00:08:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,281,1620716400"; d="scan'208";a="476869150" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga008.fm.intel.com with ESMTP; 30 Jul 2021 00:08:42 -0700 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, rickyman7@gmail.com, Jin Yao Subject: [PATCH v3 0/2] perf tools: Add PMU alias support Date: Fri, 30 Jul 2021 15:07:15 +0800 Message-Id: <20210730070717.30997-1-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A perf uncore PMU may have two PMU names, a real name and an alias name. With this patch set, the perf tool can monitor the PMU with either the real name or the alias. Use the real name, $ perf stat -e uncore_cha_2/event=1/ -x, 4044879584,,uncore_cha_2/event=1/,2528059205,100.00,, Use the alias, $ perf stat -e uncore_type_0_2/event=1/ -x, 3659675336,,uncore_type_0_2/event=1/,2287306455,100.00,, v3: --- 1. Use fgets() to replace fscanf(). 2. Resource cleanup. v2: --- Add test case to verify the real name and alias name having same effect. Jin Yao (1): perf tests: Test for PMU alias Kan Liang (1): perf pmu: Add PMU alias support tools/perf/arch/x86/util/pmu.c | 129 +++++++++++++++++++++++++++++++- tools/perf/tests/parse-events.c | 92 +++++++++++++++++++++++ tools/perf/util/parse-events.y | 3 +- tools/perf/util/pmu.c | 26 ++++++- tools/perf/util/pmu.h | 5 ++ 5 files changed, 250 insertions(+), 5 deletions(-) -- 2.27.0