[PATCH] perf vendor events amd: Fix Zen 5 MAB allocation events

Sandipan Das posted 1 patch 2 weeks, 2 days ago
tools/perf/pmu-events/arch/x86/amdzen5/load-store.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] perf vendor events amd: Fix Zen 5 MAB allocation events
Posted by Sandipan Das 2 weeks, 2 days ago
The unit masks for PMCx041 vary across different generations of Zen
processors. Fix the Zen 5 events based on PMCx041 as they incorrectly
use the same unit masks as that of Zen 4.

Fixes: 45c072f2537a ("perf vendor events amd: Add Zen 5 core events")
Reported-by: Suyash Mahar <smahar@meta.com>
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
---
 tools/perf/pmu-events/arch/x86/amdzen5/load-store.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json b/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json
index ff6627a77805..06bbaea15925 100644
--- a/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json
+++ b/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json
@@ -70,19 +70,19 @@
     "EventName": "ls_mab_alloc.load_store_allocations",
     "EventCode": "0x41",
     "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for load-store allocations.",
-    "UMask": "0x3f"
+    "UMask": "0x07"
   },
   {
     "EventName": "ls_mab_alloc.hardware_prefetcher_allocations",
     "EventCode": "0x41",
     "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for hardware prefetcher allocations.",
-    "UMask": "0x40"
+    "UMask": "0x08"
   },
   {
     "EventName": "ls_mab_alloc.all_allocations",
     "EventCode": "0x41",
     "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for all types of allocations.",
-    "UMask": "0x7f"
+    "UMask": "0x0f"
   },
   {
     "EventName": "ls_dmnd_fills_from_sys.local_l2",
-- 
2.43.0
Re: [PATCH] perf vendor events amd: Fix Zen 5 MAB allocation events
Posted by Ian Rogers 2 weeks, 2 days ago
On Thu, Jan 22, 2026 at 12:10 AM Sandipan Das <sandipan.das@amd.com> wrote:
>
> The unit masks for PMCx041 vary across different generations of Zen
> processors. Fix the Zen 5 events based on PMCx041 as they incorrectly
> use the same unit masks as that of Zen 4.
>
> Fixes: 45c072f2537a ("perf vendor events amd: Add Zen 5 core events")
> Reported-by: Suyash Mahar <smahar@meta.com>
> Signed-off-by: Sandipan Das <sandipan.das@amd.com>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/pmu-events/arch/x86/amdzen5/load-store.json | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json b/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json
> index ff6627a77805..06bbaea15925 100644
> --- a/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json
> +++ b/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json
> @@ -70,19 +70,19 @@
>      "EventName": "ls_mab_alloc.load_store_allocations",
>      "EventCode": "0x41",
>      "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for load-store allocations.",
> -    "UMask": "0x3f"
> +    "UMask": "0x07"
>    },
>    {
>      "EventName": "ls_mab_alloc.hardware_prefetcher_allocations",
>      "EventCode": "0x41",
>      "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for hardware prefetcher allocations.",
> -    "UMask": "0x40"
> +    "UMask": "0x08"
>    },
>    {
>      "EventName": "ls_mab_alloc.all_allocations",
>      "EventCode": "0x41",
>      "BriefDescription": "Miss Address Buffer (MAB) entries allocated by a Load-Store (LS) pipe for all types of allocations.",
> -    "UMask": "0x7f"
> +    "UMask": "0x0f"
>    },
>    {
>      "EventName": "ls_dmnd_fills_from_sys.local_l2",
> --
> 2.43.0
>
Re: [PATCH] perf vendor events amd: Fix Zen 5 MAB allocation events
Posted by Arnaldo Carvalho de Melo 1 week, 5 days ago
On Thu, Jan 22, 2026 at 08:00:09AM -0800, Ian Rogers wrote:
> On Thu, Jan 22, 2026 at 12:10 AM Sandipan Das <sandipan.das@amd.com> wrote:
> > The unit masks for PMCx041 vary across different generations of Zen
> > processors. Fix the Zen 5 events based on PMCx041 as they incorrectly
> > use the same unit masks as that of Zen 4.

> > Fixes: 45c072f2537a ("perf vendor events amd: Add Zen 5 core events")
> > Reported-by: Suyash Mahar <smahar@meta.com>
> > Signed-off-by: Sandipan Das <sandipan.das@amd.com>
 
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks, applied to perf-tools-next,

- Arnaldo