From patchwork Fri Jun 28 14:35:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 168095 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3782524ilk; Fri, 28 Jun 2019 07:37:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUNG0/sxbQL5j/d9JGudM3mrbvxeBCKQlg2eKa9dzbuIRF8yeyYC/2vDddieMPaWr1KnDc X-Received: by 2002:a17:90a:22c6:: with SMTP id s64mr13888263pjc.5.1561732666003; Fri, 28 Jun 2019 07:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561732665; cv=none; d=google.com; s=arc-20160816; b=pf6Ikqm4XmL+aNjv+wvvEaqrY5carjgUk/J4dRbNGWDwyRmmuOpeDHOOB4VVZWJKlD FfGA3rhS7CxTUa46cf6zGqtIVw5q9J2pLHSfCMjApIXhyirjCoYQKUTRoc/fSBVOtieE c7FuQCwb5xp+2cCgvVsNb6RkYgh+AWygCx41GL9x7oTeOXVdyY4oO02eJ0Pkmwl2+Eik 42biplqI32/MqHA9BgFC9jKTRv6pPT00VpmWDA9evZVD2TD5zG6VbZVhAjVSsKlTdLow +xHrS+BcDhqJYNPXPE56xIFw5dpik+0iYEh/dZTbTQX8j0Czt6lAffdh88Z73YR/kbnN A5hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=D2Bzr1zTWxiJGNKG2FhMGONlH0DAczWc3RVHaCQFZOc=; b=ajWJrgYvrPEi0oskGvB60SQx1UeHC7GVah2xmWXu4CXhn3oMAb9yta+UFqHS1MEzHP LT9PV2rjKlnlIpZVkfBkJpfHzicMaKNRUfhA7Yn2+vfzB/tx65qXXFMmLiUTAnrz9faT NfzuWwcmeyum+Ipo72V7RR5ydLyDhONNmdEl24A7eXLsT3xUFswR0PZM4t5U1xrs9xA0 eN0isGfYBV+Kc5yDplxV7tLu0O99NBsM6JVPceZTC0/w10V/pP00JdY3lTqmuNY1JCOO pVCr5ip8Yg0zTsW4JIHdZKdErBknsyaASgVDqvWoMLwgaiSy0Ml6p8SR8JNb6rxaegQ5 I8GQ== 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 p2si2682188pff.164.2019.06.28.07.37.45; Fri, 28 Jun 2019 07:37:45 -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 S1726967AbfF1Oho (ORCPT + 30 others); Fri, 28 Jun 2019 10:37:44 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57350 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726836AbfF1Oh3 (ORCPT ); Fri, 28 Jun 2019 10:37:29 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 43BCE9BEFCADED0D27FC; Fri, 28 Jun 2019 22:37:27 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 28 Jun 2019 22:37:21 +0800 From: John Garry To: , , , , , , , , , , , , CC: , , , , , John Garry Subject: [PATCH v3 1/4] perf pmu: Support more complex PMU event aliasing Date: Fri, 28 Jun 2019 22:35:49 +0800 Message-ID: <1561732552-143038-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1561732552-143038-1-git-send-email-john.garry@huawei.com> References: <1561732552-143038-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The jevent "Unit" field is used for uncore PMU alias definition. The form uncore_pmu_example_X is supported, where "X" is a wildcard, to support multiple instances of the same PMU in a system. Unfortunately this format not suitable for all uncore PMUs; take the Hisi DDRC uncore PMU for example, where the name is in the form hisi_scclX_ddrcY. For for current jevent parsing, we would be required to hardcode an uncore alias translation for each possible value of X. This is not scalable. Instead, add support for "Unit" field in the form "hisi_sccl,ddrc", where we can match by hisi_scclX and ddrcY. Tokens in Unit field are delimited by ','. Signed-off-by: John Garry --- tools/perf/util/pmu.c | 46 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 7e7299fee550..cfc916819c59 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -700,6 +700,46 @@ struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu) return map; } +static bool pmu_uncore_alias_match(const char *pmu_name, const char *name) +{ + char *tmp, *tok, *str; + bool res; + + str = strdup(pmu_name); + if (!str) + return false; + + /* + * uncore alias may be from different PMU with common prefix + */ + tok = strtok_r(str, ",", &tmp); + if (strncmp(pmu_name, tok, strlen(tok))) { + res = false; + goto out; + } + + /* + * Match more complex aliases where the alias name is a comma-delimited + * list of tokens, orderly contained in the matching PMU name. + * + * Example: For alias "socket,pmuname" and PMU "socketX_pmunameY", we + * match "socket" in "socketX_pmunameY" and then "pmuname" in + * "pmunameY". + */ + for (; tok; name += strlen(tok), tok = strtok_r(NULL, ",", &tmp)) { + name = strstr(name, tok); + if (!name) { + res = false; + goto out; + } + } + + res = true; +out: + free(str); + return res; +} + /* * From the pmu_events_map, find the table of PMU events that corresponds * to the current running CPU. Then, add all PMU events from that table @@ -730,12 +770,8 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) break; } - /* - * uncore alias may be from different PMU - * with common prefix - */ if (pmu_is_uncore(name) && - !strncmp(pname, name, strlen(pname))) + pmu_uncore_alias_match(pname, name)) goto new_alias; if (strcmp(pname, name)) From patchwork Fri Jun 28 14:35:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 168091 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3782283ilk; Fri, 28 Jun 2019 07:37:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAZa3hEglhM7XmBYrwhDawcxeLWfhB+s7VSIGZiQSb7bA8ULNIvWXJDizRFj5sQxcv97Li X-Received: by 2002:a63:f346:: with SMTP id t6mr10019168pgj.203.1561732652690; Fri, 28 Jun 2019 07:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561732652; cv=none; d=google.com; s=arc-20160816; b=rVvyMSYGrrZPffxF7Hu1U9ZgCbZiREb34rSYjYJ0oMmcMYDHWJ3933fyqSiKUaGmVt DVVY598sjsr08B8adNXSJJQxpsLCLpL6aFPVcXp5Fh7E04MW1wUGYy4AWwItGgARTdAw Vr2afvp0kjQdbwTGVsTFacLQy5TpcREDs0tVaRiGjgfqIeCO1rcF6Cxss85YI7e7J4MA iDM/uBvvQHuKoxzMdCg0j+HihsLLGcYDX/gaey9b4bmF7mAp9Jf+6muPJC4dzI00iu+H Jxy31NPn4EssiUI7Gp1hyo2fmtg+J/8xNTOwkmJ3iu/YaDmX5ps8Gq8agfPK8GfhyldF dbwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=deXeL42yC0atD7SQRQoyrEEgX7SvHhFeF9dt/COQdeA=; b=Rh5lRcPet3GkNecIVUZiXr45bS1A1FJqaO38mLH0vK/JUGpQ8EjJo6M7ubTIrW9Twp VkcbFNQxkMh5sT6BVHm8WwuyWeBIQ3yryzGGwcVNm6duwNkmAOcsWrOya2ZKgZT4mviH prLiKxSJu8hz200F6SYSVgdDqeI4qQ4xtVxQp56sMbPnv1GBFgWtKNjeSqL0o6atPMQa W/tbVUr9ukyrRZgZCtpy3kfXN+0n4cRTVrOsa/ILtwMqlSpmR1Xz3+LWuWyiasgpEFzV Fd3Vhgs/eD5iSPSoHN+BmdafsEgvHQ3g98UQyqLjBAa+ArGpFfp5VflPpN1bfGhy76l5 yCrQ== 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 i20si2072998pgl.215.2019.06.28.07.37.32; Fri, 28 Jun 2019 07:37:32 -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 S1726888AbfF1Ohb (ORCPT + 30 others); Fri, 28 Jun 2019 10:37:31 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57354 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726616AbfF1Oh3 (ORCPT ); Fri, 28 Jun 2019 10:37:29 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 53E1E68FDC627A3F17F4; Fri, 28 Jun 2019 22:37:27 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 28 Jun 2019 22:37:21 +0800 From: John Garry To: , , , , , , , , , , , , CC: , , , , , John Garry Subject: [PATCH v3 2/4] perf jevents: Add support for Hisi hip08 DDRC PMU aliasing Date: Fri, 28 Jun 2019 22:35:50 +0800 Message-ID: <1561732552-143038-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1561732552-143038-1-git-send-email-john.garry@huawei.com> References: <1561732552-143038-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for Hisi hip08 DDRC PMU aliasing. We can now do something like this: $perf list [snip] uncore ddrc: uncore_hisi_ddrc.act_cmd [DDRC active commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.flux_rcmd [DDRC read commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.flux_wcmd [DDRC write commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.flux_wr [DDRC precharge commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.rnk_chg [DDRC rank commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.rw_chg [DDRC read and write changes. Unit: hisi_sccl,ddrc] Performance counter stats for 'system wide': 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc0] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc3] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc0] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc3] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc3] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc0] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc0] 20,421 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc3] 1.001559011 seconds time elapsed The kernel driver is in drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c Signed-off-by: John Garry --- .../arm64/hisilicon/hip08/uncore-ddrc.json | 44 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 45 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json -- 2.17.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json new file mode 100644 index 000000000000..0d1556fcdffe --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json @@ -0,0 +1,44 @@ +[ + { + "EventCode": "0x02", + "EventName": "uncore_hisi_ddrc.flux_wcmd", + "BriefDescription": "DDRC write commands", + "PublicDescription": "DDRC write commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x03", + "EventName": "uncore_hisi_ddrc.flux_rcmd", + "BriefDescription": "DDRC read commands", + "PublicDescription": "DDRC read commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x04", + "EventName": "uncore_hisi_ddrc.flux_wr", + "BriefDescription": "DDRC precharge commands", + "PublicDescription": "DDRC precharge commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x05", + "EventName": "uncore_hisi_ddrc.act_cmd", + "BriefDescription": "DDRC active commands", + "PublicDescription": "DDRC active commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x06", + "EventName": "uncore_hisi_ddrc.rnk_chg", + "BriefDescription": "DDRC rank commands", + "PublicDescription": "DDRC rank commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x07", + "EventName": "uncore_hisi_ddrc.rw_chg", + "BriefDescription": "DDRC read and write changes", + "PublicDescription": "DDRC read and write changes", + "Unit": "hisi_sccl,ddrc", + }, +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index 58f77fd0f59f..cf9a60333554 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -236,6 +236,7 @@ static struct map { { "CPU-M-CF", "cpum_cf" }, { "CPU-M-SF", "cpum_sf" }, { "UPI LL", "uncore_upi" }, + { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, {} }; From patchwork Fri Jun 28 14:35:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 168092 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3782344ilk; Fri, 28 Jun 2019 07:37:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqGc8ANh7AFU3eiCNAgEzhZ4k5P5d6/KhYsZLIB+fhT7qmtJVvs2ptDz25b5bvWFMlsqz4 X-Received: by 2002:a63:5a0a:: with SMTP id o10mr9864898pgb.282.1561732655668; Fri, 28 Jun 2019 07:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561732655; cv=none; d=google.com; s=arc-20160816; b=iY0J6wanaGtZ5dKYM4TPf0jSrvjYfOCjZpA8wupvMRru2GyewxmkC2ZucXj5QBfz1R HH1HXCWur97/XUJ5Xcna58R33odzU+DOfSc5PQZduVgLJ54/S+EUCDUb8+pKH5uRbgAF a2EFttfMCdxuE2tOjg0pU4uEUw9GvwGJULX3nt7OFhWWPB+SkvqLZ7bGCU7KHHEUR2Jp iajHZnB50GOHg2OiN3WuwiEM+CVqW2s2sZ7eKTGrUNVF1B6LykJjIVw/lJsZNCPoaYhh ffIxD/Z7kFHkbF29+RhIGIb8NCOmvwN/dyoIudbLgMAtBwJJqPyLozxBuG56Dz3819HO PXQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=qBTi/NbeZw/a6LYSKl+ZsYkhjRm9ggdYfb7/9d4XIuk=; b=u4PcWkuo37wXIQgiWafkvx0qjm1IC6GyYmHUt1U0BnAEyiR2ZDwJExkWEUDiZ4hOER xt4H0AwKYv3TTuspK6awsGaPg2ChJPPvRbYPJ7xQN3y4FGQi9Bwpri/APRk07witO/Q4 f9fIgZ2NXb/3UhBH5dBD0VLmaFLPR9Op9nA34mp6FW5BvyhHWV4Pu2QloJ52kmhLmbXx 2+qVU3prBqoblXZ4yvOCFDz/ntaO+WkGB18aMcZCXHmZR8A7+52d38lgtjxNVisM+vVr +C+7gQDSB5rdeY2svJoTuu2EFC0XxjeUqooDHY0hF7CojoihlGQU3YvsMzB7iVZopkE1 F2VQ== 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 18si1162998pgq.310.2019.06.28.07.37.35; Fri, 28 Jun 2019 07:37:35 -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 S1726917AbfF1Ohe (ORCPT + 30 others); Fri, 28 Jun 2019 10:37:34 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57366 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726884AbfF1Ohc (ORCPT ); Fri, 28 Jun 2019 10:37:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5DC775EF2A6AC9C31FA2; Fri, 28 Jun 2019 22:37:27 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 28 Jun 2019 22:37:21 +0800 From: John Garry To: , , , , , , , , , , , , CC: , , , , , John Garry Subject: [PATCH v3 3/4] perf jevents: Add support for Hisi hip08 HHA PMU aliasing Date: Fri, 28 Jun 2019 22:35:51 +0800 Message-ID: <1561732552-143038-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1561732552-143038-1-git-send-email-john.garry@huawei.com> References: <1561732552-143038-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for Hisi hip08 HHA PMU aliasing. The kernel driver is in drivers/perf/hisilicon/hisi_uncore_hha_pmu.c Signed-off-by: John Garry --- .../arm64/hisilicon/hip08/uncore-hha.json | 51 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 52 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json -- 2.17.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json new file mode 100644 index 000000000000..447d3064de90 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json @@ -0,0 +1,51 @@ +[ + { + "EventCode": "0x00", + "EventName": "uncore_hisi_hha.rx_ops_num", + "BriefDescription": "The number of all operations received by the HHA", + "PublicDescription": "The number of all operations received by the HHA", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x01", + "EventName": "uncore_hisi_hha.rx_outer", + "BriefDescription": "The number of all operations received by the HHA from another socket", + "PublicDescription": "The number of all operations received by the HHA from another socket", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x02", + "EventName": "uncore_hisi_hha.rx_sccl", + "BriefDescription": "The number of all operations received by the HHA from another SCCL in this socket", + "PublicDescription": "The number of all operations received by the HHA from another SCCL in this socket", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1c", + "EventName": "uncore_hisi_hha.rd_ddr_64b", + "BriefDescription": "The number of read operations sent by HHA to DDRC which size is 64 bytes", + "PublicDescription": "The number of read operations sent by HHA to DDRC which size is 64bytes", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1d", + "EventName": "uncore_hisi_hha.wr_dr_64b", + "BriefDescription": "The number of write operations sent by HHA to DDRC which size is 64 bytes", + "PublicDescription": "The number of write operations sent by HHA to DDRC which size is 64 bytes", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1e", + "EventName": "uncore_hisi_hha.rd_ddr_128b", + "BriefDescription": "The number of read operations sent by HHA to DDRC which size is 128 bytes", + "PublicDescription": "The number of read operations sent by HHA to DDRC which size is 128 bytes", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1f", + "EventName": "uncore_hisi_hha.wr_ddr_128b", + "BriefDescription": "The number of write operations sent by HHA to DDRC which size is 128 bytes", + "PublicDescription": "The number of write operations sent by HHA to DDRC which size is 128 bytes", + "Unit": "hisi_sccl,hha", + }, +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index cf9a60333554..909e53e3b5bd 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -237,6 +237,7 @@ static struct map { { "CPU-M-SF", "cpum_sf" }, { "UPI LL", "uncore_upi" }, { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, + { "hisi_sccl,hha", "hisi_sccl,hha" }, {} }; From patchwork Fri Jun 28 14:35:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 168093 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3782386ilk; Fri, 28 Jun 2019 07:37:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjrcD+exrWGqHVw9dv7i99tINfYLqquzYI8zrp3bMLySG+v/4jkS+Avh+TjUZaTih6ZtP8 X-Received: by 2002:a65:5b8e:: with SMTP id i14mr6307072pgr.188.1561732658702; Fri, 28 Jun 2019 07:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561732658; cv=none; d=google.com; s=arc-20160816; b=gkKx8+GYNc6IpzX1l+xV3iCQdgxFM6CHb/wTCn/CjB2of25WAxteC42UuvE1Q9p5Wc Q81/6Es/bzUmDNeSKFimyL9oTxnlong55MpiyDdOlTT+h30CvoHCUurm7NhQx1NROVOx m15mXdACPHVveuw08dRPjZDPC7dadVZ1nESC9sv5TNaK0gqdwxWMh8UuijwH46Inw880 AsWTHDqy7xzSb4ScsVROOe2E8I4fixlRh5q56zJGaD94A7mpWTcEu7GipfDfV+9L0ZDQ iMwRzBoNn5lMYMkJEnUgo8jWTb7t4DIJGRKzwPP1JdxF0fULvTtcfHwIDUGk4XoQ1hG4 E5Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=TI25TindjYvlLNLnWCSEHkmETJBVjxzm1GU/9+TbXHc=; b=mo+vFINr6uaXAihpvcF9mVAcuPkaxFNUM8kxc3RxmZ0QO5M8sdXBWTUKXuUfWJGiMQ E2yEPPdgA0qVJaeMLIFJfSAElXZ12g/kyHuzPB0+6SpgbhhQySQoXe2YhGAj2AZQRlz1 WCEO+SZ09q6u27oXCcj8FkZFBOcmjovY74y6dfwZ48sAAR2nfdNLgEH9rMqj2/jBP4a5 2xpJ2Ysv8qwj0UAfbR9kKPtEaqwr/GruO2J9GVC8ObDJ2zvTD0Wk6Iwnq1TR2XsMU9kx 2ZfmMmqojQxK8/+vNbVqAPGWPLeeJK5De71z/68H7ofvNw/jtrQ6xf9dZCTcuShLG2Ay QfUg== 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 b21si2276650plz.21.2019.06.28.07.37.38; Fri, 28 Jun 2019 07:37:38 -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 S1726956AbfF1Ohh (ORCPT + 30 others); Fri, 28 Jun 2019 10:37:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8232 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726884AbfF1Ohg (ORCPT ); Fri, 28 Jun 2019 10:37:36 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 533D1AB3EDE336B3E937; Fri, 28 Jun 2019 22:37:32 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 28 Jun 2019 22:37:21 +0800 From: John Garry To: , , , , , , , , , , , , CC: , , , , , John Garry Subject: [PATCH v3 4/4] perf jevents: Add support for Hisi hip08 L3C PMU aliasing Date: Fri, 28 Jun 2019 22:35:52 +0800 Message-ID: <1561732552-143038-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1561732552-143038-1-git-send-email-john.garry@huawei.com> References: <1561732552-143038-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for Hisi hip08 L3C PMU aliasing. The kernel driver is in drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c Signed-off-by: John Garry --- .../arm64/hisilicon/hip08/uncore-l3c.json | 37 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 38 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json -- 2.17.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json new file mode 100644 index 000000000000..ca48747642e1 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json @@ -0,0 +1,37 @@ +[ + { + "EventCode": "0x00", + "EventName": "uncore_hisi_l3c.rd_cpipe", + "BriefDescription": "Total read accesses", + "PublicDescription": "Total read accesses", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x01", + "EventName": "uncore_hisi_l3c.wr_cpipe", + "BriefDescription": "Total write accesses", + "PublicDescription": "Total write accesses", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x02", + "EventName": "uncore_hisi_l3c.rd_hit_cpipe", + "BriefDescription": "Total read hits", + "PublicDescription": "Total read hits", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x03", + "EventName": "uncore_hisi_l3c.wr_hit_cpipe", + "BriefDescription": "Total write hits", + "PublicDescription": "Total write hits", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x04", + "EventName": "uncore_hisi_l3c.victim_num", + "BriefDescription": "l3c precharge commands", + "PublicDescription": "l3c precharge commands", + "Unit": "hisi_sccl,l3c", + }, +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index 909e53e3b5bd..7d241efd03de 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -238,6 +238,7 @@ static struct map { { "UPI LL", "uncore_upi" }, { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, { "hisi_sccl,hha", "hisi_sccl,hha" }, + { "hisi_sccl,l3c", "hisi_sccl,l3c" }, {} };