Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1130666pxv; Thu, 22 Jul 2021 23:57:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/rPdH3x2OwecABkMEKzxYPItDHHOR5tXqOp50wDPcKyB/q/sxZd2FTK952yAAUZ8OXz1Q X-Received: by 2002:a92:dc4f:: with SMTP id x15mr2596997ilq.64.1627023469206; Thu, 22 Jul 2021 23:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627023469; cv=none; d=google.com; s=arc-20160816; b=FWOkMSovlTG84UmYOQ9gxp4F1ZiUcq7BJ3Im7P95Mo4fOqfiJDP+XufJZOeHlwAzR9 k2zsWrFJqxTIce1460xcbK3P2udPojVjGB2qfQaNVKav0NqaSg/Ts5fk/F3cbeadXIeM fH9iogyGniH0QS9ngZv5I5YxSn0lslpBhIwqVoIvoTpGd9uzVViJ83wRdNGcpLhH2GAe iARR8XVrbjVxmSlr7vmhgROKlYdV0cg8PoNi1EqNixtnNHoA3kLu753MHp3YGxJpwfzu gw5LDAjhHMfTnI0TovjNprR9H75m/nYsNRDQI7JnsOQyiSD1tAynA7Iu98qEfqz0HwdN /hSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=N2SvWk/CSXFeNPgw/MVvNGVlwc0oBuroUsWLW9qY8SQ=; b=wB1MYh2C0Jetfst5bv2akreBZXvyWRfXnMHubzmwh3hECRQ3HucPbSvhDBZxKoZB3/ bffprhXO2GluVlF1B2/rjxTb+kM37AjHdA1L4b7pVyAlNIDncRgxfTQYXofzRNT47srT gXSPL901S0XtdoQfyRdUGLsJHLDi2z+ymPGJh9w5ZsXSkZAPlOXT0WskDSFeFKgaCk1U N4g9rPRRlrMQ1xi7931QAM6XNoMVU3evsGvK8VoW26DbF4XbPoIZsKKgBZvvFm5qPA03 XrtgL1K5qFzPQbugQNfXd3d321StdQJYNXlWdJGe0/uS+dnwxBtTdY8B6D+smFyrFOAN 81wg== 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 d2si17124596iow.58.2021.07.22.23.57.37; Thu, 22 Jul 2021 23:57:49 -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 S234093AbhGWGPr (ORCPT + 99 others); Fri, 23 Jul 2021 02:15:47 -0400 Received: from mga18.intel.com ([134.134.136.126]:8460 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234004AbhGWGPq (ORCPT ); Fri, 23 Jul 2021 02:15:46 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="199088508" X-IronPort-AV: E=Sophos;i="5.84,263,1620716400"; d="scan'208";a="199088508" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 23:56:20 -0700 X-IronPort-AV: E=Sophos;i="5.84,263,1620716400"; d="scan'208";a="471017491" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.4.147]) ([10.238.4.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 23:56:17 -0700 Subject: Re: [PATCH v1] perf pmu: Add PMU alias support To: John Garry , 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, Kan Liang References: <20210722014546.11948-1-yao.jin@linux.intel.com> From: "Jin, Yao" Message-ID: <6b9fb1dc-5f53-d378-9119-84e991a0c86e@linux.intel.com> Date: Fri, 23 Jul 2021 14:56:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John, On 7/22/2021 6:28 PM, John Garry wrote: > On 22/07/2021 02:45, Jin Yao wrote: >> From: Kan Liang >> >> A perf uncore PMU may have two PMU names, a real name and an alias. The >> alias is exported at /sys/bus/event_source/devices/uncore_*/alias. >> The perf tool should support the alias as well. >> >> Add alias_name in the struct perf_pmu to store the alias. For the PMU >> which doesn't have an alias. It's NULL. >> >> Introduce two X86 specific functions to retrieve the real name and the >> alias separately. >> >> Only go through the sysfs to retrieve the mapping between the real name >> and the alias once. The result is cached in a list, uncore_pmu_list. >> >> Nothing changed for the other ARCHs. >> >> With the patch, 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,, > > Having a self-test case would be nice. And it's questionable why this goes in x86 code. > OK, I will add test cases for uncore PMU alias. For why it's now only x86 specific code, my understanding is, currently x86 has this usage case, we can further extend it to other ARCHs and make it a generic way in future. Thanks Jin Yao > Thanks, > John