有没有办法通过 Linux 中的 perf 工具捕获 L3 缓存命中和未命中。根据 的输出perf list cache
,支持 L1 和 LLC 缓存。根据perf的源码中perf_evsel__hw_cache数组的定义:
const char *perf_evsel__hw_cache[PERF_COUNT_HW_CACHE_MAX]
[PERF_EVSEL__MAX_ALIASES] = {
{ "L1-dcache", "l1-d", "l1d", "L1-data", },
{ "L1-icache", "l1-i", "l1i", "L1-instruction", },
{ "LLC", "L2", },
{ "dTLB", "d-tlb", "Data-TLB", },
{ "iTLB", "i-tlb", "Instruction-TLB", },
{ "branch", "branches", "bpu", "btb", "bpc", },
{ "node", },
};
LLC 是 L2-cache 的别名。我的问题是如何通过 Linux 中的 perf 工具捕获 L3 缓存命中和未命中。提前致谢!