From 215028b8df93bc6a59e7d97336223e5a3bec5e69 Mon Sep 17 00:00:00 2001 From: William Sumendap Date: Thu, 19 Dec 2024 13:41:40 -0800 Subject: [PATCH] Add stalls per dispatch slot metrics in GENOA (#331) Summary: Pull Request resolved: https://github.com/facebookincubator/dynolog/pull/331 ``dyno.stalls_no_execute_mhz`` no longer applicable in AMD Genoa, because stalls are caulculated on a basis of the number of dispatch slots not cycles. Add new ODS keys to represent these metrics. Reviewed By: bigzachattack Differential Revision: D67264483 fbshipit-source-id: b269d19d38a4261680fbf446b0f4a1e5d927be95 --- hbt/src/perf_event/AmdEvents.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hbt/src/perf_event/AmdEvents.h b/hbt/src/perf_event/AmdEvents.h index e7294885..b01589ec 100644 --- a/hbt/src/perf_event/AmdEvents.h +++ b/hbt/src/perf_event/AmdEvents.h @@ -172,6 +172,21 @@ constexpr PmuMsr kStalledCyclesIdqEmpty{ .amdCore = {.event = 0x87, .unitMask = 0x2}}; constexpr PmuMsr kStalledCyclesAny{.amdCore = {.event = 0x87, .unitMask = 0x4}}; +// Zen4 Stalls per dispatch slots +constexpr PmuMsr kFrontendBoundStalls{ + .amdCore = {.event = 0xa0, .unitMask = 0x1, .event_11_8 = 0x1}}; +constexpr PmuMsr kBackendBoundStalls{ + .amdCore = {.event = 0xa0, .unitMask = 0x1e, .event_11_8 = 0x1}}; +constexpr PmuMsr kSMTContentionStalls{ + .amdCore = {.event = 0xa0, .unitMask = 0x60, .event_11_8 = 0x1}}; +// Bad speculation stalls events +constexpr PmuMsr kMacroOpsDispatched{ + .amdCore = {.event = 0xaa, .unitMask = 0x7}}; +// constexpr PmuMsr kRetiredUOps{.amdCore = {.event = 0xc1}}; +constexpr PmuMsr kDispatchSlots{ + .amdCore = { + .event = 0x76}}; // this is unhalted cycles, which is already defined + // Retired uops constexpr PmuMsr kRetiredUOps{.amdCore = {.event = 0xc1}}; constexpr PmuMsr kDeUopsDispatchedOpCache{