Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp416255pxv; Thu, 22 Jul 2021 03:30:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvysKUP4ydwm+LylAf2rm0CSGUCyYhiuoTty2EPnUQ3j7R/ilzXLvyC2qdyDIB3ysHHweK X-Received: by 2002:a92:c504:: with SMTP id r4mr26723260ilg.131.1626949823743; Thu, 22 Jul 2021 03:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626949823; cv=none; d=google.com; s=arc-20160816; b=cBaBA2VDdd4EXTD2kcBEQpy7nJACAvcBQvQ0rXIJSFJhSif/ZNq2U4Qq5eqX9Ra00N YRVJKV8xX12RBixzEN7aXLrkBjX224OlaOZ5BdhFEqKptIuDgb3h8aoW3fTghOJ+0kO7 1YXDVY4o7A1H4+6tQy+PTskqa3+oS92R6nG0nzd3l7ttzralYOqNld8FibDxF93q1DU5 LpOanFByQsQ2615wVGxT6i+BzHiDJ5AR7t/8Xsm5/yKrYsc78YmPxZIL7wXraGzWYOzz UlAaiIhAMOgA+6nmq56AhS20CqNwTvuv65OLh9saqTs8xqJlABGpulF5N3dVoz63cQv4 rvtQ== 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=0LzBzYaBvC7fhT9fG/9CzenK05ev+avg5CpF4c0noE8=; b=vWwNVUWMHfKWdFTV95hQ2LCL0lyXuXZYY2Si0FFmHI/1iXeARhte7hu/TTTbrcyiEU IvaqZSc4pMzUMf5BDPQmoZYbzW8w3Ro45DN3aYFdnq5chVlMvjsPIS4FUYGCIavlenbM 8NXw9fO//Zs5YHJ4oMCeCOfq8pymnJ0ZSu5SzdaOsExHEqF9Y0SiwDb1jq8dezdGgxzh Bv/AecWDuzMJozbN8jGDkyrdxq7IXOfIihcg8a7GXIKD7HM1KiWzKlDBzJDgGP36LIja HQuiDshnudXvy5u//d9NVivE727NF97vpvoaxbIotR7pCCEP25MReZB+drIM/l8R97L1 YNxg== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h29si19972505jav.81.2021.07.22.03.30.12; Thu, 22 Jul 2021 03:30:23 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbhGVJr7 (ORCPT + 99 others); Thu, 22 Jul 2021 05:47:59 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3448 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbhGVJr5 (ORCPT ); Thu, 22 Jul 2021 05:47:57 -0400 Received: from fraeml739-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4GVpK53J9hz6H7l7; Thu, 22 Jul 2021 18:16:57 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml739-chm.china.huawei.com (10.206.15.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 22 Jul 2021 12:28:30 +0200 Received: from [10.47.26.161] (10.47.26.161) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 22 Jul 2021 11:28:29 +0100 Subject: Re: [PATCH v1] perf pmu: Add PMU alias support To: Jin Yao , , , , , CC: , , , , , Kan Liang References: <20210722014546.11948-1-yao.jin@linux.intel.com> From: John Garry Message-ID: Date: Thu, 22 Jul 2021 11:28:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20210722014546.11948-1-yao.jin@linux.intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.26.161] X-ClientProxiedBy: lhreml706-chm.china.huawei.com (10.201.108.55) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, John