Skip to content

Commit

Permalink
Update perf_data_converter to reflect the new perf mem level names in…
Browse files Browse the repository at this point in the history
… AMD ZEN4.

Further slice the L3 hits to local, near, and far L3.

PiperOrigin-RevId: 689060853
  • Loading branch information
xliuprof authored and s-kanev committed Jan 15, 2025
1 parent a85578f commit df4052a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/perf_data_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,15 @@ std::string DataSrcString(uint64_t mem_lvl) {
if (mem_lvl & quipper::PERF_MEM_LVL_L1) return "L1";
if (mem_lvl & quipper::PERF_MEM_LVL_LFB) return "LFB";
if (mem_lvl & quipper::PERF_MEM_LVL_L2) return "L2";
if (mem_lvl & quipper::PERF_MEM_LVL_L3) return "L3";
if (mem_lvl & quipper::PERF_MEM_LVL_L3) return "Local L3";
if (mem_lvl & quipper::PERF_MEM_LVL_LOC_RAM) return "Local DRAM";
if (mem_lvl &
(quipper::PERF_MEM_LVL_REM_RAM1 | quipper::PERF_MEM_LVL_REM_RAM2))
return "Remote DRAM";
if (mem_lvl &
(quipper::PERF_MEM_LVL_REM_CCE1 | quipper::PERF_MEM_LVL_REM_CCE2))
return "Remote Cache";
// AMD ZEN4+ (Genoa+) supports Near and Far L3 levels. For other AMD platforms
// Local and Near L3 both refer to Local L3.
if (mem_lvl & quipper::PERF_MEM_LVL_REM_CCE1) return "Near L3";
if (mem_lvl & quipper::PERF_MEM_LVL_REM_CCE2) return "Far L3";
if (mem_lvl & quipper::PERF_MEM_LVL_IO) return "IO Memory";
if (mem_lvl & quipper::PERF_MEM_LVL_UNC) return "Uncached Memory";
return "Unknown Level";
Expand Down
2 changes: 1 addition & 1 deletion src/perf_data_converter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ TEST_F(PerfDataConverterTest, ConvertsDataSrc) {
const std::unordered_map<std::string, uint64_t> expected_counts{
{"L1", 2},
{"L2", 1},
{"L3", 1},
{"Local L3", 1},
};
EXPECT_THAT(counts_by_datasrc, UnorderedPointwise(Eq(), expected_counts));
}
Expand Down

0 comments on commit df4052a

Please sign in to comment.