Thread (11 messages) 11 messages, 2 authors, 2021-01-21

Re: [PATCH V1 3/4] perf vendor events: Add JSON metrics for imx8mq DDR Perf

From: John Garry <hidden>
Date: 2021-01-20 09:28:34
Also in: linux-arm-kernel

On 20/01/2021 05:46, Joakim Zhang wrote:
quoted
-----Original Message-----
From: John Garry<redacted>
Sent: 2021年1月19日 20:27
To: Joakim Zhang<redacted>;acme@kernel.org;
jolsa@redhat.com
Cc:will@kernel.org;linux-perf-users@vger.kernel.org; dl-linux-imx
[off-list ref];mark.rutland@arm.com;
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V1 3/4] perf vendor events: Add JSON metrics for imx8mq
DDR Perf

On 19/01/2021 11:00, Joakim Zhang wrote:
quoted
quoted
-----Original Message-----
From: John Garry<redacted>
Sent: 2021年1月19日 18:40
To: Joakim Zhang<redacted>;acme@kernel.org;
jolsa@redhat.com
Cc:will@kernel.org;linux-perf-users@vger.kernel.org; dl-linux-imx
[off-list ref];mark.rutland@arm.com;
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V1 3/4] perf vendor events: Add JSON metrics for
imx8mq DDR Perf

On 19/01/2021 02:56, Joakim Zhang wrote:
quoted
index 000000000000..c3e9f89a4a4d
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.
+++ js
+++ on
@@ -0,0 +1,26 @@
+[
+   {
+	    "BriefDescription": "bandwidth usage for lpddr4 evk board",
Why mention the evk board specifically? Is this metric only specific
to that board, and not all i.MX8MQ platforms?
Yes, John, we have lpddr4 evk board and ddr4 evk borad......
How is this supposed to work?

So perf matches on the identifier file for system PMUs; however the contents of
this file are based on the HW implementation for imx DDR PMU, not the board.
Yes, I know this feature is for system PMU, not board. You know DDR bandwidth calculation is based on DDR clock frequency, which is vary form boards.

e.g.
lpddr4 board, DDR clock frequency is 750MHZ:
"MetricExpr": "(( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) * 4 * 4 / duration_time) / (750 * 1000000 * 4 * 4)"

ddr4 board, DDR clock frequency is 600MHZ.
"MetricExpr": "(( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) * 4 * 4 / duration_time) / (600 * 1000000 * 4 * 4)"

I give different metric names,
"MetricName": "imx8mm_bandwidth_usage.lpddr4"
"MetricName": "imx8mm_bandwidth_usage.ddr4"
But that is just not how things are done. We - or I - would expect that 
perf tool would have the intelligence to know the appropriate metric for 
that specific platform. Or, more specifically, we should not present the 
user with many metrics and expect him/her to know the appropriate metric 
for the specific board.

Are there other cases for other architectures where things are done like 
this?

Thanks,
John
So users can select correct bandwidth metric according to their own board types. To a certain extent, it can also support some board-level metrics.

If it is okay for you, I will send a V2 to replace ( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) with ( imx8mm_ddr.read_cycles + imx8mm_ddr.write_cycles ).
quoted
quoted
John, change to your new framework, I found it can't support all features
which is supported in 5.10 kernel.

Yes, so let me know about all the problems.
It should have worked as 5.10 kernel at my side. Thanks.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help