Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4085153pxt; Tue, 10 Aug 2021 19:52:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynLsLE+Bnt0ktWeX9tOIayzlpFjpJM6d8mcXeTZq0Qvf9OUI0Urngu92pcUpNf6j+qwwPl X-Received: by 2002:a50:ae02:: with SMTP id c2mr8916004edd.307.1628650326245; Tue, 10 Aug 2021 19:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628650326; cv=none; d=google.com; s=arc-20160816; b=jWzjueTC1ij3oiyq1ZBj5vCLsjnY5B7jF48f3kK2Jf/+XAMw00aZUUkxH2Zp5APPnH 4SlSt49kCdaanVSWn1fKw4Neqld3EqCimC3UzW9fEVU+0Y34di+6JBy3SmpBT/XCmvTI vqhS5Y1ooCIZr7/8xBnzN9hYw9QxdgwuuN5PHlRvgb6CSnBANkpnyYmP7RvVivcK0hyc miyBiiOurU0EVwz4BSxqrX+uTqnH9yCb0pCagCLvjkO9lh9ijiK1zLVgOq14EicDKMH6 YSg8exgC+4wTr0CwFsplZ7CzIJ6aJVfDpsw5HMAx/Qufs8JPWz3zzt7CU7fnow8n7uSl QYww== 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=cgByCOgdPSyWljKZuOSviEw3UtXgNHktyzncTbomAq8=; b=CpkqEBV4J56E3jK1zdgkM+uyW1E+5pOqgZRsJHm/T9tWr8YT1KxP9eWrRQ/hoQPP3Z IQDTSnqyov+jVU81/hLR36wSM6/WmxJrnwPdeKvb0w2jM6zT5MGQ1J8EFlqH3fzXW+ty qa1EBeU0f5G2XAB3/aBgHGdnyLrcP7SDrWjCGjOpKR3Rsi8Zc/SS4VhLoPmcWj2oER+g m0ZfHQubTdIMDsqiB5JL5kOsBYqX+BCWvlvrv5UoolSjIcX2ISsLGD7U7a89PWKGpvfQ c2D2hzWS8oKcKbyvCCyaB+Q/30aAgB3dbZAjuPzskBl3xVos1FzcSATSDW298AbcAmyp reEA== 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 cm23si7027337edb.514.2021.08.10.19.51.35; Tue, 10 Aug 2021 19:52:06 -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 S231634AbhHKCuc (ORCPT + 99 others); Tue, 10 Aug 2021 22:50:32 -0400 Received: from mga05.intel.com ([192.55.52.43]:49103 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbhHKCuc (ORCPT ); Tue, 10 Aug 2021 22:50:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10072"; a="300628185" X-IronPort-AV: E=Sophos;i="5.84,311,1620716400"; d="scan'208";a="300628185" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2021 19:50:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,311,1620716400"; d="scan'208";a="445651161" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga007.fm.intel.com with ESMTP; 10 Aug 2021 19:50:05 -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 v4 0/2] perf tools: Add PMU alias support Date: Wed, 11 Aug 2021 10:48:25 +0800 Message-Id: <20210811024827.9483-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,, v4: --- 1. Fix memory leaks in pmu_lookup. 2. Rebase to perf/core. 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 | 47 +++++++++--- tools/perf/util/pmu.h | 5 ++ 5 files changed, 264 insertions(+), 12 deletions(-) -- 2.17.1