Skip to content

Commit d3751fd

Browse files
xliuprofshantuo
authored andcommitted
Update perf_data_converter to reflect the new perf mem level names in AMD ZEN4.
Further slice the L3 hits to local, near, and far L3. PiperOrigin-RevId: 689060853
1 parent 81c171b commit d3751fd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/perf_data_converter.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,15 @@ std::string DataSrcString(uint64_t mem_lvl) {
364364
if (mem_lvl & quipper::PERF_MEM_LVL_L1) return "L1";
365365
if (mem_lvl & quipper::PERF_MEM_LVL_LFB) return "LFB";
366366
if (mem_lvl & quipper::PERF_MEM_LVL_L2) return "L2";
367-
if (mem_lvl & quipper::PERF_MEM_LVL_L3) return "L3";
367+
if (mem_lvl & quipper::PERF_MEM_LVL_L3) return "Local L3";
368368
if (mem_lvl & quipper::PERF_MEM_LVL_LOC_RAM) return "Local DRAM";
369369
if (mem_lvl &
370370
(quipper::PERF_MEM_LVL_REM_RAM1 | quipper::PERF_MEM_LVL_REM_RAM2))
371371
return "Remote DRAM";
372-
if (mem_lvl &
373-
(quipper::PERF_MEM_LVL_REM_CCE1 | quipper::PERF_MEM_LVL_REM_CCE2))
374-
return "Remote Cache";
372+
// AMD ZEN4+ (Genoa+) supports Near and Far L3 levels. For other AMD platforms
373+
// Local and Near L3 both refer to Local L3.
374+
if (mem_lvl & quipper::PERF_MEM_LVL_REM_CCE1) return "Near L3";
375+
if (mem_lvl & quipper::PERF_MEM_LVL_REM_CCE2) return "Far L3";
375376
if (mem_lvl & quipper::PERF_MEM_LVL_IO) return "IO Memory";
376377
if (mem_lvl & quipper::PERF_MEM_LVL_UNC) return "Uncached Memory";
377378
return "Unknown Level";

src/perf_data_converter_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ TEST_F(PerfDataConverterTest, ConvertsDataSrc) {
10731073
const std::unordered_map<std::string, uint64_t> expected_counts{
10741074
{"L1", 2},
10751075
{"L2", 1},
1076-
{"L3", 1},
1076+
{"Local L3", 1},
10771077
};
10781078
EXPECT_THAT(counts_by_datasrc, UnorderedPointwise(Eq(), expected_counts));
10791079
}

0 commit comments

Comments
 (0)