2023-07-28 07:26:27

by Jing Zhang

[permalink] [raw]
Subject: [PATCH v5 0/3] Add aliases and JSON metrics for Yitian710 DDR

Hi,

I add aliases and JSON metrics for Yitian710 DDR. The kernel part that
this series depends on has been applied to for-next/perf. And this series
have all been reviewed. Can you help to apply them? Thank you.

Thanks,
Jing

Change since v4:
- Kernel patch has applied to for-next/perf, so this patchset only has
tools part and docs.
- Fixed patch conflicts.
- Link: https://lore.kernel.org/all/[email protected]/

Jing Zhang (3):
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 +
.../arm64/freescale/yitian710/sys/ali_drw.json | 373 +++++++++++++++++++++
.../arm64/freescale/yitian710/sys/metrics.json | 20 ++
tools/perf/pmu-events/jevents.py | 1 +
4 files changed, 399 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



2023-07-28 07:32:20

by Jing Zhang

[permalink] [raw]
Subject: [PATCH v5 3/3] docs: perf: Update metric usage for Alibaba's T-Head PMU driver

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

Signed-off-by: Jing Zhang <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Reviewed-by: John Garry <[email protected]>
---
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


2023-07-28 08:04:43

by Jing Zhang

[permalink] [raw]
Subject: [PATCH v5 2/3] perf vendor events: Add JSON metrics for Yitian 710 DDR

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

Signed-off-by: Jing Zhang <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Reviewed-by: John Garry <[email protected]>
---
.../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


2023-07-28 13:55:38

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH v5 0/3] Add aliases and JSON metrics for Yitian710 DDR

Em Fri, Jul 28, 2023 at 03:09:32PM +0800, Jing Zhang escreveu:
> Hi,
>
> I add aliases and JSON metrics for Yitian710 DDR. The kernel part that
> this series depends on has been applied to for-next/perf. And this series
> have all been reviewed. Can you help to apply them? Thank you.
>
> Thanks,
> Jing

Thanks, applied.

- Arnaldo


> Change since v4:
> - Kernel patch has applied to for-next/perf, so this patchset only has
> tools part and docs.
> - Fixed patch conflicts.
> - Link: https://lore.kernel.org/all/[email protected]/
>
> Jing Zhang (3):
> 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 +
> .../arm64/freescale/yitian710/sys/ali_drw.json | 373 +++++++++++++++++++++
> .../arm64/freescale/yitian710/sys/metrics.json | 20 ++
> tools/perf/pmu-events/jevents.py | 1 +
> 4 files changed, 399 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
>

--

- Arnaldo