linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
@ 2023-06-20  7:12 Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 1/4] driver/perf: Add identifier sysfs file for Yitian 710 DDR Jing Zhang
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Jing Zhang @ 2023-06-20  7:12 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers
  Cc: Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song, Jing Zhang

Hi all,

I add an identifier sysfs file for the yitian710 SoC DDR to allow
userspace to identify the specific implementation of the device,
so that the perf tool can match the corresponding uncore events and
metrics through the identifier. Then added yitian710 SoC DDR
metrics and events alias.

Change since v3:
- Split the CMN and ali_drw patches. This patchset only contains
  ali_drw PMU related patches. The CMN metric related patches will
  be in another patchset.
- Link: https://lore.kernel.org/all/1685438374-33287-1-git-send-email-renyu.zj@linux.alibaba.com/

$perf list:
...
ali_drw:
  chi_rxdat
       [A packet at CHI RXDAT interface (write data). Unit: ali_drw]
  chi_rxrsp
       [A packet at CHI RXRSP interface. Unit: ali_drw]
  chi_txdat
       [A packet at CHI TXDAT interface (read data). Unit: ali_drw]
  chi_txreq
       [A packet at CHI TXREQ interface (request). Unit: ali_drw]
  cycle
       [The ddr cycle. Unit: ali_drw]
...
ali_drw:
  ddr_read_bandwidth.all
       [The ddr read bandwidth(MB/s). Unit: ali_drw ]
  ddr_write_bandwidth.all
       [The ddr write bandwidth(MB/s). Unit: ali_drw ]
...

$perf stat -M ddr_read_bandwidth.all ./test

Performance counter stats for 'system wide':

            38,150      hif_rd        #  2.4 MB/s  ddr_read_bandwidth.all
     1,000,957,941 ns   duration_time

       1.000957941 seconds time elapsed

Jing Zhang (4):
  driver/perf: Add identifier sysfs file for Yitian 710 DDR
  perf jevents: Add support for Yitian 710 DDR PMU aliasing
  perf vendor events: Add JSON metrics for Yitian 710 DDR
  docs: perf: Update metric usage for Alibaba's T-Head PMU driver

 Documentation/admin-guide/perf/alibaba_pmu.rst     |   5 +
 drivers/perf/alibaba_uncore_drw_pmu.c              |  27 ++
 .../arm64/freescale/yitian710/sys/ali_drw.json     | 373 +++++++++++++++++++++
 .../arm64/freescale/yitian710/sys/metrics.json     |  20 ++
 tools/perf/pmu-events/jevents.py                   |   1 +
 5 files changed, 426 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v4 1/4] driver/perf: Add identifier sysfs file for Yitian 710 DDR
  2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
@ 2023-06-20  7:12 ` Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 2/4] perf jevents: Add support for Yitian 710 DDR PMU aliasing Jing Zhang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Jing Zhang @ 2023-06-20  7:12 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers
  Cc: Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song, Jing Zhang

To allow userspace to identify the specific implementation of the device,
add an "identifier" sysfs file.

The perf tool can match the Yitian 710 DDR metric through the identifier.

Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Acked-by: Ian Rogers <irogers@google.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
---
 drivers/perf/alibaba_uncore_drw_pmu.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c
index a7689fe..fe075fd 100644
--- a/drivers/perf/alibaba_uncore_drw_pmu.c
+++ b/drivers/perf/alibaba_uncore_drw_pmu.c
@@ -236,10 +236,37 @@ static ssize_t ali_drw_pmu_cpumask_show(struct device *dev,
 	.attrs = ali_drw_pmu_cpumask_attrs,
 };
 
+static ssize_t ali_drw_pmu_identifier_show(struct device *dev,
+					struct device_attribute *attr,
+					char *page)
+{
+	return sysfs_emit(page, "%s\n", "ali_drw_pmu");
+}
+
+static umode_t ali_drw_pmu_identifier_attr_visible(struct kobject *kobj,
+						struct attribute *attr, int n)
+{
+	return attr->mode;
+}
+
+static struct device_attribute ali_drw_pmu_identifier_attr =
+	__ATTR(identifier, 0444, ali_drw_pmu_identifier_show, NULL);
+
+static struct attribute *ali_drw_pmu_identifier_attrs[] = {
+	&ali_drw_pmu_identifier_attr.attr,
+	NULL
+};
+
+static const struct attribute_group ali_drw_pmu_identifier_attr_group = {
+	.attrs = ali_drw_pmu_identifier_attrs,
+	.is_visible = ali_drw_pmu_identifier_attr_visible
+};
+
 static const struct attribute_group *ali_drw_pmu_attr_groups[] = {
 	&ali_drw_pmu_events_attr_group,
 	&ali_drw_pmu_cpumask_attr_group,
 	&ali_drw_pmu_format_group,
+	&ali_drw_pmu_identifier_attr_group,
 	NULL,
 };
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 2/4] perf jevents: Add support for Yitian 710 DDR PMU aliasing
  2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 1/4] driver/perf: Add identifier sysfs file for Yitian 710 DDR Jing Zhang
@ 2023-06-20  7:12 ` Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 3/4] perf vendor events: Add JSON metrics for Yitian 710 DDR Jing Zhang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Jing Zhang @ 2023-06-20  7:12 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers
  Cc: Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song, Jing Zhang

Add support for T-HEAD Yitian 710 SoC DDR PMU aliasing.

Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Acked-by: Ian Rogers <irogers@google.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
---
 .../arm64/freescale/yitian710/sys/ali_drw.json     | 373 +++++++++++++++++++++
 tools/perf/pmu-events/jevents.py                   |   1 +
 2 files changed, 374 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json

diff --git a/tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json b/tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json
new file mode 100644
index 0000000..2d49bf7
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json
@@ -0,0 +1,373 @@
+[
+	{
+		"BriefDescription": "A Write or Read Op at HIF interface. The unit is 64B.",
+		"ConfigCode": "0x0",
+		"EventName": "hif_rd_or_wr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Write Op at HIF interface. The unit is 64B.",
+		"ConfigCode": "0x1",
+		"EventName": "hif_wr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Read Op at HIF interface. The unit is 64B.",
+		"ConfigCode": "0x2",
+		"EventName": "hif_rd",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Read-Modify-Write Op at HIF interface. The unit is 64B.",
+		"ConfigCode": "0x3",
+		"EventName": "hif_rmw",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A high priority Read at HIF interface. The unit is 64B.",
+		"ConfigCode": "0x4",
+		"EventName": "hif_hi_pri_rd",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A write data cycle at DFI interface (to DRAM).",
+		"ConfigCode": "0x7",
+		"EventName": "dfi_wr_data_cycles",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A read data cycle at DFI interface (to DRAM).",
+		"ConfigCode": "0x8",
+		"EventName": "dfi_rd_data_cycles",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A high priority read becomes critical.",
+		"ConfigCode": "0x9",
+		"EventName": "hpr_xact_when_critical",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A low priority read becomes critical.",
+		"ConfigCode": "0xA",
+		"EventName": "lpr_xact_when_critical",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A write becomes critical.",
+		"ConfigCode": "0xB",
+		"EventName": "wr_xact_when_critical",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "An Activate(ACT) command to DRAM.",
+		"ConfigCode": "0xC",
+		"EventName": "op_is_activate",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Read or Write CAS command to DRAM.",
+		"ConfigCode": "0xD",
+		"EventName": "op_is_rd_or_wr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "An Activate(ACT) command for read to DRAM.",
+		"ConfigCode": "0xE",
+		"EventName": "op_is_rd_activate",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Read CAS command to DRAM.",
+		"ConfigCode": "0xF",
+		"EventName": "op_is_rd",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Write CAS command to DRAM.",
+		"ConfigCode": "0x10",
+		"EventName": "op_is_wr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Masked Write command to DRAM.",
+		"ConfigCode": "0x11",
+		"EventName": "op_is_mwr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Precharge(PRE) command to DRAM.",
+		"ConfigCode": "0x12",
+		"EventName": "op_is_precharge",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Precharge(PRE) required by read or write.",
+		"ConfigCode": "0x13",
+		"EventName": "precharge_for_rdwr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Precharge(PRE) required by other conditions.",
+		"ConfigCode": "0x14",
+		"EventName": "precharge_for_other",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A read-write turnaround.",
+		"ConfigCode": "0x15",
+		"EventName": "rdwr_transitions",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A write combine(merge) in write data buffer.",
+		"ConfigCode": "0x16",
+		"EventName": "write_combine",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Write-After-Read hazard.",
+		"ConfigCode": "0x17",
+		"EventName": "war_hazard",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Read-After-Write hazard.",
+		"ConfigCode": "0x18",
+		"EventName": "raw_hazard",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Write-After-Write hazard.",
+		"ConfigCode": "0x19",
+		"EventName": "waw_hazard",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank0 enters self-refresh(SRE).",
+		"ConfigCode": "0x1A",
+		"EventName": "op_is_enter_selfref_rk0",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank1 enters self-refresh(SRE).",
+		"ConfigCode": "0x1B",
+		"EventName": "op_is_enter_selfref_rk1",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank2 enters self-refresh(SRE).",
+		"ConfigCode": "0x1C",
+		"EventName": "op_is_enter_selfref_rk2",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank3 enters self-refresh(SRE).",
+		"ConfigCode": "0x1D",
+		"EventName": "op_is_enter_selfref_rk3",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank0 enters power-down(PDE).",
+		"ConfigCode": "0x1E",
+		"EventName": "op_is_enter_powerdown_rk0",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank1 enters power-down(PDE).",
+		"ConfigCode": "0x1F",
+		"EventName": "op_is_enter_powerdown_rk1",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank2 enters power-down(PDE).",
+		"ConfigCode": "0x20",
+		"EventName": "op_is_enter_powerdown_rk2",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "Rank3 enters power-down(PDE).",
+		"ConfigCode": "0x21",
+		"EventName": "op_is_enter_powerdown_rk3",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A cycle that Rank0 stays in self-refresh mode.",
+		"ConfigCode": "0x26",
+		"EventName": "selfref_mode_rk0",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A cycle that Rank1 stays in self-refresh mode.",
+		"ConfigCode": "0x27",
+		"EventName": "selfref_mode_rk1",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A cycle that Rank2 stays in self-refresh mode.",
+		"ConfigCode": "0x28",
+		"EventName": "selfref_mode_rk2",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A cycle that Rank3 stays in self-refresh mode.",
+		"ConfigCode": "0x29",
+		"EventName": "selfref_mode_rk3",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "An auto-refresh(REF) command to DRAM.",
+		"ConfigCode": "0x2A",
+		"EventName": "op_is_refresh",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A critical auto-refresh(REF) command to DRAM.",
+		"ConfigCode": "0x2B",
+		"EventName": "op_is_crit_ref",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "An MRR or MRW command to DRAM.",
+		"ConfigCode": "0x2D",
+		"EventName": "op_is_load_mode",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A ZQCal command to DRAM.",
+		"ConfigCode": "0x2E",
+		"EventName": "op_is_zqcl",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "At least one entry in read queue reaches the visible window limit.",
+		"ConfigCode": "0x30",
+		"EventName": "visible_window_limit_reached_rd",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "At least one entry in write queue reaches the visible window limit.",
+		"ConfigCode": "0x31",
+		"EventName": "visible_window_limit_reached_wr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A DQS Oscillator MPC command to DRAM.",
+		"ConfigCode": "0x34",
+		"EventName": "op_is_dqsosc_mpc",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A DQS Oscillator MRR command to DRAM.",
+		"ConfigCode": "0x35",
+		"EventName": "op_is_dqsosc_mrr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A Temperature Compensated Refresh(TCR) MRR command to DRAM.",
+		"ConfigCode": "0x36",
+		"EventName": "op_is_tcr_mrr",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A ZQCal Start command to DRAM.",
+		"ConfigCode": "0x37",
+		"EventName": "op_is_zqstart",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A ZQCal Latch command to DRAM.",
+		"ConfigCode": "0x38",
+		"EventName": "op_is_zqlatch",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A packet at CHI TXREQ interface (request).",
+		"ConfigCode": "0x39",
+		"EventName": "chi_txreq",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A packet at CHI TXDAT interface (read data).",
+		"ConfigCode": "0x3A",
+		"EventName": "chi_txdat",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A packet at CHI RXDAT interface (write data).",
+		"ConfigCode": "0x3B",
+		"EventName": "chi_rxdat",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A packet at CHI RXRSP interface.",
+		"ConfigCode": "0x3C",
+		"EventName": "chi_rxrsp",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "A violation detected in TZC.",
+		"ConfigCode": "0x3D",
+		"EventName": "tsz_vio",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"BriefDescription": "The ddr cycle.",
+		"ConfigCode": "0x80",
+		"EventName": "cycle",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	}
+]
diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index 7cff2c6..aff4051 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -257,6 +257,7 @@ class JsonEvent:
           'cpu_core': 'cpu_core',
           'cpu_atom': 'cpu_atom',
           'arm_cmn': 'arm_cmn',
+          'ali_drw': 'ali_drw',
       }
       return table[unit] if unit in table else f'uncore_{unit.lower()}'
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 3/4] perf vendor events: Add JSON metrics for Yitian 710 DDR
  2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 1/4] driver/perf: Add identifier sysfs file for Yitian 710 DDR Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 2/4] perf jevents: Add support for Yitian 710 DDR PMU aliasing Jing Zhang
@ 2023-06-20  7:12 ` Jing Zhang
  2023-06-20  7:12 ` [PATCH v4 4/4] docs: perf: Update metric usage for Alibaba's T-Head PMU driver Jing Zhang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Jing Zhang @ 2023-06-20  7:12 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers
  Cc: Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song, Jing Zhang

Add JSON metrics for T-HEAD Yitian 710 SoC DDR.

Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Acked-by: Ian Rogers <irogers@google.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
---
 .../arch/arm64/freescale/yitian710/sys/metrics.json  | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json

diff --git a/tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json
new file mode 100644
index 0000000..bc865b3
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json
@@ -0,0 +1,20 @@
+[
+	{
+		"MetricName": "ddr_read_bandwidth.all",
+		"BriefDescription": "The ddr read bandwidth(MB/s).",
+		"MetricGroup": "ali_drw",
+		"MetricExpr": "hif_rd * 64 / 1e6 / duration_time",
+		"ScaleUnit": "1MB/s",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	},
+	{
+		"MetricName": "ddr_write_bandwidth.all",
+		"BriefDescription": "The ddr write bandwidth(MB/s).",
+		"MetricGroup": "ali_drw",
+		"MetricExpr": "(hif_wr + hif_rmw) * 64 / 1e6 / duration_time",
+		"ScaleUnit": "1MB/s",
+		"Unit": "ali_drw",
+		"Compat": "ali_drw_pmu"
+	}
+]
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 4/4] docs: perf: Update metric usage for Alibaba's T-Head PMU driver
  2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
                   ` (2 preceding siblings ...)
  2023-06-20  7:12 ` [PATCH v4 3/4] perf vendor events: Add JSON metrics for Yitian 710 DDR Jing Zhang
@ 2023-06-20  7:12 ` Jing Zhang
  2023-06-20  7:30   ` John Garry
  2023-06-20 19:04 ` [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Namhyung Kim
  2023-07-27 12:22 ` Will Deacon
  5 siblings, 1 reply; 13+ messages in thread
From: Jing Zhang @ 2023-06-20  7:12 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers
  Cc: Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song, Jing Zhang

Alibaba's T-Head ali_drw PMU supports DDR bandwidth metrics. Update
its usage in the documentation.

Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Acked-by: Ian Rogers <irogers@google.com>
---
 Documentation/admin-guide/perf/alibaba_pmu.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/admin-guide/perf/alibaba_pmu.rst b/Documentation/admin-guide/perf/alibaba_pmu.rst
index 11de998..7d84002 100644
--- a/Documentation/admin-guide/perf/alibaba_pmu.rst
+++ b/Documentation/admin-guide/perf/alibaba_pmu.rst
@@ -88,6 +88,11 @@ data bandwidth::
     -e ali_drw_27080/hif_rmw/ \
     -e ali_drw_27080/cycle/ -- sleep 10
 
+Example usage of counting all memory read/write bandwidth by metric::
+
+  perf stat -M ddr_read_bandwidth.all -- sleep 10
+  perf stat -M ddr_write_bandwidth.all -- sleep 10
+
 The average DRAM bandwidth can be calculated as follows:
 
 - Read Bandwidth =  perf_hif_rd * DDRC_WIDTH * DDRC_Freq / DDRC_Cycle
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 4/4] docs: perf: Update metric usage for Alibaba's T-Head PMU driver
  2023-06-20  7:12 ` [PATCH v4 4/4] docs: perf: Update metric usage for Alibaba's T-Head PMU driver Jing Zhang
@ 2023-06-20  7:30   ` John Garry
  0 siblings, 0 replies; 13+ messages in thread
From: John Garry @ 2023-06-20  7:30 UTC (permalink / raw)
  To: Jing Zhang, Will Deacon, Mark Rutland, Jonathan Corbet,
	Shuai Xue, Ian Rogers
  Cc: Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song

On 20/06/2023 08:12, Jing Zhang wrote:
> Alibaba's T-Head ali_drw PMU supports DDR bandwidth metrics. Update
> its usage in the documentation.
> 
> Signed-off-by: Jing Zhang<renyu.zj@linux.alibaba.com>
> Acked-by: Ian Rogers<irogers@google.com>

Reviewed-by: John Garry <john.g.garry@oracle.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
                   ` (3 preceding siblings ...)
  2023-06-20  7:12 ` [PATCH v4 4/4] docs: perf: Update metric usage for Alibaba's T-Head PMU driver Jing Zhang
@ 2023-06-20 19:04 ` Namhyung Kim
  2023-06-21  3:08   ` Jing Zhang
  2023-07-27 12:22 ` Will Deacon
  5 siblings, 1 reply; 13+ messages in thread
From: Namhyung Kim @ 2023-06-20 19:04 UTC (permalink / raw)
  To: Jing Zhang
  Cc: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers, Robin Murphy, James Clark, Mike Leach,
	Leo Yan, Ilkka Koskinen, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, linux-kernel, linux-arm-kernel, linux-perf-users,
	linux-doc, Zhuo Song

Hello,

On Tue, Jun 20, 2023 at 12:17 AM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
>
> Hi all,
>
> I add an identifier sysfs file for the yitian710 SoC DDR to allow
> userspace to identify the specific implementation of the device,
> so that the perf tool can match the corresponding uncore events and
> metrics through the identifier. Then added yitian710 SoC DDR
> metrics and events alias.
>
> Change since v3:
> - Split the CMN and ali_drw patches. This patchset only contains
>   ali_drw PMU related patches. The CMN metric related patches will
>   be in another patchset.
> - Link: https://lore.kernel.org/all/1685438374-33287-1-git-send-email-renyu.zj@linux.alibaba.com/
>
> $perf list:
> ...
> ali_drw:
>   chi_rxdat
>        [A packet at CHI RXDAT interface (write data). Unit: ali_drw]
>   chi_rxrsp
>        [A packet at CHI RXRSP interface. Unit: ali_drw]
>   chi_txdat
>        [A packet at CHI TXDAT interface (read data). Unit: ali_drw]
>   chi_txreq
>        [A packet at CHI TXREQ interface (request). Unit: ali_drw]
>   cycle
>        [The ddr cycle. Unit: ali_drw]
> ...
> ali_drw:
>   ddr_read_bandwidth.all
>        [The ddr read bandwidth(MB/s). Unit: ali_drw ]
>   ddr_write_bandwidth.all
>        [The ddr write bandwidth(MB/s). Unit: ali_drw ]
> ...
>
> $perf stat -M ddr_read_bandwidth.all ./test
>
> Performance counter stats for 'system wide':
>
>             38,150      hif_rd        #  2.4 MB/s  ddr_read_bandwidth.all
>      1,000,957,941 ns   duration_time
>
>        1.000957941 seconds time elapsed
>
> Jing Zhang (4):
>   driver/perf: Add identifier sysfs file for Yitian 710 DDR
>   perf jevents: Add support for Yitian 710 DDR PMU aliasing
>   perf vendor events: Add JSON metrics for Yitian 710 DDR
>   docs: perf: Update metric usage for Alibaba's T-Head PMU driver

So patch 1 is for the kernel, and patch 2-4 depend on it, right?

I'm curious why the first patch is needed, presumably the PMU
should have 'ali_drw' in the name already.  Do we use substring
match for the compat name in the JSON metric?

Thanks,
Namhyung

>
>  Documentation/admin-guide/perf/alibaba_pmu.rst     |   5 +
>  drivers/perf/alibaba_uncore_drw_pmu.c              |  27 ++
>  .../arm64/freescale/yitian710/sys/ali_drw.json     | 373 +++++++++++++++++++++
>  .../arm64/freescale/yitian710/sys/metrics.json     |  20 ++
>  tools/perf/pmu-events/jevents.py                   |   1 +
>  5 files changed, 426 insertions(+)
>  create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json
>  create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json
>
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-20 19:04 ` [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Namhyung Kim
@ 2023-06-21  3:08   ` Jing Zhang
  2023-06-21  5:00     ` Namhyung Kim
  0 siblings, 1 reply; 13+ messages in thread
From: Jing Zhang @ 2023-06-21  3:08 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers, Robin Murphy, James Clark, Mike Leach,
	Leo Yan, Ilkka Koskinen, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, linux-kernel, linux-arm-kernel, linux-perf-users,
	linux-doc, Zhuo Song



在 2023/6/21 上午3:04, Namhyung Kim 写道:
> Hello,
> 
> On Tue, Jun 20, 2023 at 12:17 AM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
>>
>> Hi all,
>>
>> I add an identifier sysfs file for the yitian710 SoC DDR to allow
>> userspace to identify the specific implementation of the device,
>> so that the perf tool can match the corresponding uncore events and
>> metrics through the identifier. Then added yitian710 SoC DDR
>> metrics and events alias.
>>
>> Change since v3:
>> - Split the CMN and ali_drw patches. This patchset only contains
>>   ali_drw PMU related patches. The CMN metric related patches will
>>   be in another patchset.
>> - Link: https://lore.kernel.org/all/1685438374-33287-1-git-send-email-renyu.zj@linux.alibaba.com/
>>
>> $perf list:
>> ...
>> ali_drw:
>>   chi_rxdat
>>        [A packet at CHI RXDAT interface (write data). Unit: ali_drw]
>>   chi_rxrsp
>>        [A packet at CHI RXRSP interface. Unit: ali_drw]
>>   chi_txdat
>>        [A packet at CHI TXDAT interface (read data). Unit: ali_drw]
>>   chi_txreq
>>        [A packet at CHI TXREQ interface (request). Unit: ali_drw]
>>   cycle
>>        [The ddr cycle. Unit: ali_drw]
>> ...
>> ali_drw:
>>   ddr_read_bandwidth.all
>>        [The ddr read bandwidth(MB/s). Unit: ali_drw ]
>>   ddr_write_bandwidth.all
>>        [The ddr write bandwidth(MB/s). Unit: ali_drw ]
>> ...
>>
>> $perf stat -M ddr_read_bandwidth.all ./test
>>
>> Performance counter stats for 'system wide':
>>
>>             38,150      hif_rd        #  2.4 MB/s  ddr_read_bandwidth.all
>>      1,000,957,941 ns   duration_time
>>
>>        1.000957941 seconds time elapsed
>>
>> Jing Zhang (4):
>>   driver/perf: Add identifier sysfs file for Yitian 710 DDR
>>   perf jevents: Add support for Yitian 710 DDR PMU aliasing
>>   perf vendor events: Add JSON metrics for Yitian 710 DDR
>>   docs: perf: Update metric usage for Alibaba's T-Head PMU driver
> 
> So patch 1 is for the kernel, and patch 2-4 depend on it, right?
> 

Hi Namhyung,

Yes, patch 2-4 depend on patch 1.

> I'm curious why the first patch is needed, presumably the PMU
> should have 'ali_drw' in the name already.  Do we use substring
> match for the compat name in the JSON metric?
> 

The main purpose of patch 1 is to add an identifier so that the Compat
field can match the corresponding event when defining aliases or metrics
for events.

For example, "Unit" can match "ali_drw" in the name and different SoCs may
be able to match ali_drw, but they may have different events, and even if
the events are the same, the meanings may be different. Therefore, the
Compat field is needed to match the Identifier to confirm which type and
revision of PMU the current SoC has. Therefore, both "Unit" and "Compat"
need to be matched at the same time. Although it seems that ali_drw is
redundantly matched currently, it is meaningful for future expansion.

Thanks,
Jing

> Thanks,
> Namhyung
> 
>>
>>  Documentation/admin-guide/perf/alibaba_pmu.rst     |   5 +
>>  drivers/perf/alibaba_uncore_drw_pmu.c              |  27 ++
>>  .../arm64/freescale/yitian710/sys/ali_drw.json     | 373 +++++++++++++++++++++
>>  .../arm64/freescale/yitian710/sys/metrics.json     |  20 ++
>>  tools/perf/pmu-events/jevents.py                   |   1 +
>>  5 files changed, 426 insertions(+)
>>  create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/ali_drw.json
>>  create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/yitian710/sys/metrics.json
>>
>> --
>> 1.8.3.1
>>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-21  3:08   ` Jing Zhang
@ 2023-06-21  5:00     ` Namhyung Kim
  2023-06-25  8:58       ` Jing Zhang
  2023-06-26 12:44       ` Will Deacon
  0 siblings, 2 replies; 13+ messages in thread
From: Namhyung Kim @ 2023-06-21  5:00 UTC (permalink / raw)
  To: Jing Zhang
  Cc: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers, Robin Murphy, James Clark, Mike Leach,
	Leo Yan, Ilkka Koskinen, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, linux-kernel, linux-arm-kernel, linux-perf-users,
	linux-doc, Zhuo Song

On Tue, Jun 20, 2023 at 8:08 PM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
>
>
>
> 在 2023/6/21 上午3:04, Namhyung Kim 写道:
> > Hello,
> >
> > On Tue, Jun 20, 2023 at 12:17 AM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
> >>
> >> Hi all,
> >>
> >> I add an identifier sysfs file for the yitian710 SoC DDR to allow
> >> userspace to identify the specific implementation of the device,
> >> so that the perf tool can match the corresponding uncore events and
> >> metrics through the identifier. Then added yitian710 SoC DDR
> >> metrics and events alias.
> >>
> >> Change since v3:
> >> - Split the CMN and ali_drw patches. This patchset only contains
> >>   ali_drw PMU related patches. The CMN metric related patches will
> >>   be in another patchset.
> >> - Link: https://lore.kernel.org/all/1685438374-33287-1-git-send-email-renyu.zj@linux.alibaba.com/
> >>
> >> $perf list:
> >> ...
> >> ali_drw:
> >>   chi_rxdat
> >>        [A packet at CHI RXDAT interface (write data). Unit: ali_drw]
> >>   chi_rxrsp
> >>        [A packet at CHI RXRSP interface. Unit: ali_drw]
> >>   chi_txdat
> >>        [A packet at CHI TXDAT interface (read data). Unit: ali_drw]
> >>   chi_txreq
> >>        [A packet at CHI TXREQ interface (request). Unit: ali_drw]
> >>   cycle
> >>        [The ddr cycle. Unit: ali_drw]
> >> ...
> >> ali_drw:
> >>   ddr_read_bandwidth.all
> >>        [The ddr read bandwidth(MB/s). Unit: ali_drw ]
> >>   ddr_write_bandwidth.all
> >>        [The ddr write bandwidth(MB/s). Unit: ali_drw ]
> >> ...
> >>
> >> $perf stat -M ddr_read_bandwidth.all ./test
> >>
> >> Performance counter stats for 'system wide':
> >>
> >>             38,150      hif_rd        #  2.4 MB/s  ddr_read_bandwidth.all
> >>      1,000,957,941 ns   duration_time
> >>
> >>        1.000957941 seconds time elapsed
> >>
> >> Jing Zhang (4):
> >>   driver/perf: Add identifier sysfs file for Yitian 710 DDR
> >>   perf jevents: Add support for Yitian 710 DDR PMU aliasing
> >>   perf vendor events: Add JSON metrics for Yitian 710 DDR
> >>   docs: perf: Update metric usage for Alibaba's T-Head PMU driver
> >
> > So patch 1 is for the kernel, and patch 2-4 depend on it, right?
> >
>
> Hi Namhyung,
>
> Yes, patch 2-4 depend on patch 1.
>
> > I'm curious why the first patch is needed, presumably the PMU
> > should have 'ali_drw' in the name already.  Do we use substring
> > match for the compat name in the JSON metric?
> >
>
> The main purpose of patch 1 is to add an identifier so that the Compat
> field can match the corresponding event when defining aliases or metrics
> for events.
>
> For example, "Unit" can match "ali_drw" in the name and different SoCs may
> be able to match ali_drw, but they may have different events, and even if
> the events are the same, the meanings may be different. Therefore, the
> Compat field is needed to match the Identifier to confirm which type and
> revision of PMU the current SoC has. Therefore, both "Unit" and "Compat"
> need to be matched at the same time. Although it seems that ali_drw is
> redundantly matched currently, it is meaningful for future expansion.

I see, thanks for the explanation.

I think you need to route the kernel patch differently.  I can apply the tools
part once the kernel patch gets Acks from others.

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-21  5:00     ` Namhyung Kim
@ 2023-06-25  8:58       ` Jing Zhang
  2023-06-26 12:44       ` Will Deacon
  1 sibling, 0 replies; 13+ messages in thread
From: Jing Zhang @ 2023-06-25  8:58 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Will Deacon, Mark Rutland, Jonathan Corbet, John Garry,
	Shuai Xue, Ian Rogers, Robin Murphy, James Clark, Mike Leach,
	Leo Yan, Ilkka Koskinen, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, linux-kernel, linux-arm-kernel, linux-perf-users,
	linux-doc, Zhuo Song



在 2023/6/21 下午1:00, Namhyung Kim 写道:
> On Tue, Jun 20, 2023 at 8:08 PM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
>>
>>
>>
>> 在 2023/6/21 上午3:04, Namhyung Kim 写道:
>>> Hello,
>>>
>>> On Tue, Jun 20, 2023 at 12:17 AM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I add an identifier sysfs file for the yitian710 SoC DDR to allow
>>>> userspace to identify the specific implementation of the device,
>>>> so that the perf tool can match the corresponding uncore events and
>>>> metrics through the identifier. Then added yitian710 SoC DDR
>>>> metrics and events alias.
>>>>
>>>> Change since v3:
>>>> - Split the CMN and ali_drw patches. This patchset only contains
>>>>   ali_drw PMU related patches. The CMN metric related patches will
>>>>   be in another patchset.
>>>> - Link: https://lore.kernel.org/all/1685438374-33287-1-git-send-email-renyu.zj@linux.alibaba.com/
>>>>
>>>> $perf list:
>>>> ...
>>>> ali_drw:
>>>>   chi_rxdat
>>>>        [A packet at CHI RXDAT interface (write data). Unit: ali_drw]
>>>>   chi_rxrsp
>>>>        [A packet at CHI RXRSP interface. Unit: ali_drw]
>>>>   chi_txdat
>>>>        [A packet at CHI TXDAT interface (read data). Unit: ali_drw]
>>>>   chi_txreq
>>>>        [A packet at CHI TXREQ interface (request). Unit: ali_drw]
>>>>   cycle
>>>>        [The ddr cycle. Unit: ali_drw]
>>>> ...
>>>> ali_drw:
>>>>   ddr_read_bandwidth.all
>>>>        [The ddr read bandwidth(MB/s). Unit: ali_drw ]
>>>>   ddr_write_bandwidth.all
>>>>        [The ddr write bandwidth(MB/s). Unit: ali_drw ]
>>>> ...
>>>>
>>>> $perf stat -M ddr_read_bandwidth.all ./test
>>>>
>>>> Performance counter stats for 'system wide':
>>>>
>>>>             38,150      hif_rd        #  2.4 MB/s  ddr_read_bandwidth.all
>>>>      1,000,957,941 ns   duration_time
>>>>
>>>>        1.000957941 seconds time elapsed
>>>>
>>>> Jing Zhang (4):
>>>>   driver/perf: Add identifier sysfs file for Yitian 710 DDR
>>>>   perf jevents: Add support for Yitian 710 DDR PMU aliasing
>>>>   perf vendor events: Add JSON metrics for Yitian 710 DDR
>>>>   docs: perf: Update metric usage for Alibaba's T-Head PMU driver
>>>
>>> So patch 1 is for the kernel, and patch 2-4 depend on it, right?
>>>
>>
>> Hi Namhyung,
>>
>> Yes, patch 2-4 depend on patch 1.
>>
>>> I'm curious why the first patch is needed, presumably the PMU
>>> should have 'ali_drw' in the name already.  Do we use substring
>>> match for the compat name in the JSON metric?
>>>
>>
>> The main purpose of patch 1 is to add an identifier so that the Compat
>> field can match the corresponding event when defining aliases or metrics
>> for events.
>>
>> For example, "Unit" can match "ali_drw" in the name and different SoCs may
>> be able to match ali_drw, but they may have different events, and even if
>> the events are the same, the meanings may be different. Therefore, the
>> Compat field is needed to match the Identifier to confirm which type and
>> revision of PMU the current SoC has. Therefore, both "Unit" and "Compat"
>> need to be matched at the same time. Although it seems that ali_drw is
>> redundantly matched currently, it is meaningful for future expansion.
> 
> I see, thanks for the explanation.
> 
> I think you need to route the kernel patch differently.  I can apply the tools
> part once the kernel patch gets Acks from others.
> 

Ok, Thank you.

Thanks,
Jing

> Thanks,
> Namhyung

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-21  5:00     ` Namhyung Kim
  2023-06-25  8:58       ` Jing Zhang
@ 2023-06-26 12:44       ` Will Deacon
  2023-06-27  7:19         ` Jing Zhang
  1 sibling, 1 reply; 13+ messages in thread
From: Will Deacon @ 2023-06-26 12:44 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Jing Zhang, Mark Rutland, Jonathan Corbet, John Garry, Shuai Xue,
	Ian Rogers, Robin Murphy, James Clark, Mike Leach, Leo Yan,
	Ilkka Koskinen, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
	linux-kernel, linux-arm-kernel, linux-perf-users, linux-doc,
	Zhuo Song

On Tue, Jun 20, 2023 at 10:00:46PM -0700, Namhyung Kim wrote:
> On Tue, Jun 20, 2023 at 8:08 PM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
> > 在 2023/6/21 上午3:04, Namhyung Kim 写道:
> > > I'm curious why the first patch is needed, presumably the PMU
> > > should have 'ali_drw' in the name already.  Do we use substring
> > > match for the compat name in the JSON metric?
> > >
> >
> > The main purpose of patch 1 is to add an identifier so that the Compat
> > field can match the corresponding event when defining aliases or metrics
> > for events.
> >
> > For example, "Unit" can match "ali_drw" in the name and different SoCs may
> > be able to match ali_drw, but they may have different events, and even if
> > the events are the same, the meanings may be different. Therefore, the
> > Compat field is needed to match the Identifier to confirm which type and
> > revision of PMU the current SoC has. Therefore, both "Unit" and "Compat"
> > need to be matched at the same time. Although it seems that ali_drw is
> > redundantly matched currently, it is meaningful for future expansion.
> 
> I see, thanks for the explanation.
> 
> I think you need to route the kernel patch differently.  I can apply the tools
> part once the kernel patch gets Acks from others.

Sorry, I missed this initially as I didn't realise there were kernel changes
hidden in this series (I saw "JSON" and ignored it...). Given that the 6.5
merge window is now open, I'll pick the kernel change up for 6.6 when I
start queueing patches in a few weeks.

Will

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-26 12:44       ` Will Deacon
@ 2023-06-27  7:19         ` Jing Zhang
  0 siblings, 0 replies; 13+ messages in thread
From: Jing Zhang @ 2023-06-27  7:19 UTC (permalink / raw)
  To: Will Deacon, Namhyung Kim
  Cc: Mark Rutland, Jonathan Corbet, John Garry, Shuai Xue, Ian Rogers,
	Robin Murphy, James Clark, Mike Leach, Leo Yan, Ilkka Koskinen,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, linux-kernel,
	linux-arm-kernel, linux-perf-users, linux-doc, Zhuo Song



在 2023/6/26 下午8:44, Will Deacon 写道:
> On Tue, Jun 20, 2023 at 10:00:46PM -0700, Namhyung Kim wrote:
>> On Tue, Jun 20, 2023 at 8:08 PM Jing Zhang <renyu.zj@linux.alibaba.com> wrote:
>>> 在 2023/6/21 上午3:04, Namhyung Kim 写道:
>>>> I'm curious why the first patch is needed, presumably the PMU
>>>> should have 'ali_drw' in the name already.  Do we use substring
>>>> match for the compat name in the JSON metric?
>>>>
>>>
>>> The main purpose of patch 1 is to add an identifier so that the Compat
>>> field can match the corresponding event when defining aliases or metrics
>>> for events.
>>>
>>> For example, "Unit" can match "ali_drw" in the name and different SoCs may
>>> be able to match ali_drw, but they may have different events, and even if
>>> the events are the same, the meanings may be different. Therefore, the
>>> Compat field is needed to match the Identifier to confirm which type and
>>> revision of PMU the current SoC has. Therefore, both "Unit" and "Compat"
>>> need to be matched at the same time. Although it seems that ali_drw is
>>> redundantly matched currently, it is meaningful for future expansion.
>>
>> I see, thanks for the explanation.
>>
>> I think you need to route the kernel patch differently.  I can apply the tools
>> part once the kernel patch gets Acks from others.
> 
> Sorry, I missed this initially as I didn't realise there were kernel changes
> hidden in this series (I saw "JSON" and ignored it...). Given that the 6.5
> merge window is now open, I'll pick the kernel change up for 6.6 when I
> start queueing patches in a few weeks.
> 
> Will

Thank you will, maybe it is because I did not describe this series well, and
it is easy to cause the patch to be ignored. I will pay attention to this
problem in the future.

Thanks,
Jing

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR
  2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
                   ` (4 preceding siblings ...)
  2023-06-20 19:04 ` [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Namhyung Kim
@ 2023-07-27 12:22 ` Will Deacon
  5 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2023-07-27 12:22 UTC (permalink / raw)
  To: John Garry, Ian Rogers, Shuai Xue, Jonathan Corbet, Mark Rutland,
	Jing Zhang
  Cc: catalin.marinas, kernel-team, Will Deacon, Robin Murphy,
	linux-doc, Namhyung Kim, linux-perf-users, Jiri Olsa,
	Adrian Hunter, linux-kernel, Zhuo Song, Alexander Shishkin,
	Mike Leach, Ilkka Koskinen, linux-arm-kernel, James Clark,
	Leo Yan

On Tue, 20 Jun 2023 15:12:32 +0800, Jing Zhang wrote:
> I add an identifier sysfs file for the yitian710 SoC DDR to allow
> userspace to identify the specific implementation of the device,
> so that the perf tool can match the corresponding uncore events and
> metrics through the identifier. Then added yitian710 SoC DDR
> metrics and events alias.
> 
> Change since v3:
> - Split the CMN and ali_drw patches. This patchset only contains
>   ali_drw PMU related patches. The CMN metric related patches will
>   be in another patchset.
> - Link: https://lore.kernel.org/all/1685438374-33287-1-git-send-email-renyu.zj@linux.alibaba.com/
> 
> [...]

Applied first patch to will (for-next/perf), thanks!

[1/4] driver/perf: Add identifier sysfs file for Yitian 710 DDR
      https://git.kernel.org/will/c/cbbc6fdd85be

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-07-27 12:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20  7:12 [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Jing Zhang
2023-06-20  7:12 ` [PATCH v4 1/4] driver/perf: Add identifier sysfs file for Yitian 710 DDR Jing Zhang
2023-06-20  7:12 ` [PATCH v4 2/4] perf jevents: Add support for Yitian 710 DDR PMU aliasing Jing Zhang
2023-06-20  7:12 ` [PATCH v4 3/4] perf vendor events: Add JSON metrics for Yitian 710 DDR Jing Zhang
2023-06-20  7:12 ` [PATCH v4 4/4] docs: perf: Update metric usage for Alibaba's T-Head PMU driver Jing Zhang
2023-06-20  7:30   ` John Garry
2023-06-20 19:04 ` [PATCH v4 0/4] Add JSON metrics for Yitian710 DDR Namhyung Kim
2023-06-21  3:08   ` Jing Zhang
2023-06-21  5:00     ` Namhyung Kim
2023-06-25  8:58       ` Jing Zhang
2023-06-26 12:44       ` Will Deacon
2023-06-27  7:19         ` Jing Zhang
2023-07-27 12:22 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).