From f3e508aa850b99ecc2432bf2a34a28f12f4ebc28 Mon Sep 17 00:00:00 2001
From: Qi Liu <liuqi115@huawei.com>
Date: Wed, 30 Nov 2022 19:01:40 +0800
Subject: [PATCH 191/201] perf jevents: Add support for HiSilicon PA PMU
 aliasing

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I63VF5

--------------------------------------------------------------------------

Add support for HiSilicon PA PMU aliasing on Hip09 platform.

Signed-off-by: Qi Liu <liuqi115@huawei.com>
Signed-off-by: Junhao He <hejunhao3@huawei.com>
Signed-off-by: hongrongxuan <hongrongxuan@huawei.com>
---
 .../arm64/hisilicon/hip09/sys/uncore-pa.json  | 86 +++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-pa.json

diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-pa.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-pa.json
new file mode 100644
index 000000000000..6ddc9b4ffa16
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-pa.json
@@ -0,0 +1,86 @@
+[
+    {
+	"EventCode": "0x78",
+	"EventName": "pa_cycles",
+	"BriefDescription": "Count of PA cycles",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventName": "cycle",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x40",
+	"EventName": "rx_req",
+	"BriefDescription": "Count of the requests received by PA link0",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x41",
+	"EventName": "rx_req_link1",
+	"BriefDescription": "Count of the requests received by PA link1",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x42",
+	"EventName": "rx_req_link2",
+	"BriefDescription": "Count of the requests received by PA link2",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x43",
+	"EventName": "rx_req_link3",
+	"BriefDescription": "Count of the requests received by PA link3",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x5c",
+	"EventName": "tx_req",
+	"BriefDescription": "Count of the requests transmitted by PA link0",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x5d",
+	"EventName": "tx_req_link1",
+	"BriefDescription": "Count of the requests transmitted by PA link1",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x5e",
+	"EventName": "tx_req_link2",
+	"BriefDescription": "Count of the requests transmitted by PA link2",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"EventCode": "0x5f",
+	"EventName": "tx_req_link3",
+	"BriefDescription": "Count of the requests transmitted by PA link3",
+	"Compat": "0x00000030",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"MetricExpr": "(rx_req + rx_req_link1 + rx_req_link2 + rx_req_link3) / duration_time",
+	"BriefDescription": "Average bandwidth of PA receive requests",
+	"Compat": "0x00000030",
+	"MetricGroup": "PA",
+	"MetricName": "pa_rx_req_bw",
+	"Unit": "hisi_sicl,pa"
+    },
+    {
+	"MetricExpr": "(tx_req + tx_req_link1 + tx_req_link2 + tx_req_link3) / duration_time",
+	"BriefDescription": "Average bandwidth of PA transmitted requests",
+	"Compat": "0x00000030",
+	"MetricGroup": "PA",
+	"MetricName": "pa_tx_req_bw",
+	"Unit": "hisi_sicl,pa"
+    }
+]
\ No newline at end of file
-- 
2.27.0

