Re: [PATCH v1] perf vendor power9 nest metrics: Correct unit from MB to MiB
From: Ian Rogers
Date: Wed Dec 10 2025 - 01:02:49 EST
On Tue, Dec 9, 2025 at 9:39 PM Madhavan Srinivasan <maddy@xxxxxxxxxxxxx> wrote:
>
>
> On 10/31/25 9:56 PM, Ian Rogers wrote:
> > 6.1e-5 is very close to 1/16384, where 16384 is 2^14, i.e. a power of
> > 2. When units are in powers of 2 the IEC unit is MiB (mebibytes)
> > rather than MB (megabytes) where the values are powers of 10. This
> > patch corrects the unit for uniformity and because such units may be
> > pattern matched against.
>
>
> Changes looks fine to me.
>
> Reviewed-by: Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>
> b/w power10 metrics file could also have this fix I guess.
Thanks for the review! I don't see the same issue clearly on power10
as the ScaleUnits are different:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/pmu-events/arch/powerpc/power10/nest_metrics.json?h=perf-tools-next
Thanks!
Ian
> > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > ---
> > .../perf/pmu-events/arch/powerpc/power9/nest_metrics.json | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json b/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json
> > index 7a5d1bf543f8..8d028a7c2777 100644
> > --- a/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json
> > +++ b/tools/perf/pmu-events/arch/powerpc/power9/nest_metrics.json
> > @@ -29,25 +29,25 @@
> > "MetricExpr" : "nest_mcs01_imc@PM_MCS01_128B_RD_DISP_PORT01@ + nest_mcs01_imc@PM_MCS01_128B_RD_DISP_PORT23@",
> > "MetricName" : "mcs01-read",
> > "MetricGroup" : "memory-bandwidth",
> > - "ScaleUnit": "6.1e-5MB"
> > + "ScaleUnit": "6.1e-5MiB"
> > },
> > {
> > "MetricExpr" : "nest_mcs23_imc@PM_MCS23_128B_RD_DISP_PORT01@ + nest_mcs23_imc@PM_MCS23_128B_RD_DISP_PORT23@",
> > "MetricName" : "mcs23-read",
> > "MetricGroup" : "memory-bandwidth",
> > - "ScaleUnit": "6.1e-5MB"
> > + "ScaleUnit": "6.1e-5MiB"
> > },
> > {
> > "MetricExpr" : "nest_mcs01_imc@PM_MCS01_128B_WR_DISP_PORT01@ + nest_mcs01_imc@PM_MCS01_128B_WR_DISP_PORT23@",
> > "MetricName" : "mcs01-write",
> > "MetricGroup" : "memory-bandwidth",
> > - "ScaleUnit": "6.1e-5MB"
> > + "ScaleUnit": "6.1e-5MiB"
> > },
> > {
> > "MetricExpr" : "nest_mcs23_imc@PM_MCS23_128B_WR_DISP_PORT01@ + nest_mcs23_imc@PM_MCS23_128B_WR_DISP_PORT23@",
> > "MetricName" : "mcs23-write",
> > "MetricGroup" : "memory-bandwidth",
> > - "ScaleUnit": "6.1e-5MB"
> > + "ScaleUnit": "6.1e-5MiB"
> > },
> > {
> > "MetricExpr" : "nest_powerbus0_imc@PM_PB_CYC@",