[PATCH v2 3/5] perf vendor events arm64:: Add i.MX94 DDR Performance Monitor metrics

Xu Yang xu.yang_2 at nxp.com
Thu Nov 6 18:55:57 PST 2025


On Tue, Nov 04, 2025 at 09:40:15AM -0800, Ian Rogers wrote:
> On Thu, Aug 21, 2025 at 4:02 AM Xu Yang <xu.yang_2 at nxp.com> wrote:
> >
> > Add JSON metrics for i.MX94 DDR Performance Monitor.
> >
> > Reviewed-by: Peng Fan <peng.fan at nxp.com>
> > Reviewed-by: Frank Li <Frank.Li at nxp.com>
> > Signed-off-by: Xu Yang <xu.yang_2 at nxp.com>
> 
> Acked-by: Ian Rogers <irogers at google.com>
> 
> > ---
> > Changes in v2:
> >  - add Rb tag
> > ---
> >  .../arch/arm64/freescale/imx94/sys/ddrc.json       |   9 +
> >  .../arch/arm64/freescale/imx94/sys/metrics.json    | 450 +++++++++++++++++++++
> >  2 files changed, 459 insertions(+)
> >
> > diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/ddrc.json
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..aa7b58721dc7e23dc9d9905a79e0c1778b7bbf11
> > --- /dev/null
> > +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/ddrc.json
> > @@ -0,0 +1,9 @@
> > +[
> > +   {
> > +           "BriefDescription": "ddr cycles event",
> > +           "EventCode": "0x00",
> > +           "EventName": "imx94_ddr.cycles",
> > +           "Unit": "imx9_ddr",
> > +           "Compat": "imx94"
> > +   }
> > +]
> > diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/metrics.json
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..629f1f52761e2210ef43a9cbba175871817e1230
> > --- /dev/null
> > +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/metrics.json
> > @@ -0,0 +1,450 @@
> > +[
> > +       {
> > +               "BriefDescription": "bandwidth usage for lpddr5 evk board",
> > +               "MetricName": "imx94_bandwidth_usage.lpddr5",
> > +               "MetricExpr": "(( imx9_ddr0 at eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x000\\,axi_id\\=0x000@ + imx9_ddr0 at eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32 / duration_time) / (4266 * 1000000 * 4)",
> 
> nit: It is possible to have metrics use other metrics, this may read
> better as (although I can't recall if the '.' needs escaping - I'm not
> sure if the 4266 is significant):
> 
> ((imx94_ddr_read.all + imx94_ddr_write.all) / duration_time)  / 17064e6
> 
> > +               "ScaleUnit": "1e2%",
> 
> nit: I think this would read more easily as "100%"

Thanks for your suggestion, Ian. 

I tried, escaping is necessary otherwise perf will report error.
But if I use imx94_ddr_read.all and imx94_ddr_write.all in imx94_bandwidth_usage.lpddr4x,
perf stat won't show correct result on my side.

root at imx95evk:~# ./perf stat -a -M imx95_bandwidth_usage.lpddr4x -I 1000
#           time             counts unit events
     1.001115585         1001234752 ns   duration_time
     2.002746508         1001632840 ns   duration_time

The previous result was:

root at imx95evk:~# perf stat -a -M imx95_bandwidth_usage.lpddr4x -I 1000
#           time             counts unit events
     1.001080251              13966      imx9_ddr0/eddrtq_pm_wr_beat_filt,axi_mask=0x000,axi_id=0x000/ #      0.0 %  imx95_bandwidth_usage.lpddr4x
     1.001080251             119741      imx9_ddr0/eddrtq_pm_rd_beat_filt0,axi_mask=0x000,axi_id=0x000/
     1.001080251         1001275128 ns   duration_time

Thanks,
Xu Yang

> 
> Thanks,
> Ian
> 



More information about the linux-arm-kernel mailing list