小编use*_*315的帖子

如何通过 Linux 中的 perf 工具捕获 L3 缓存命中和未命中

有什么方法可以通过 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",                                                              },
};
Run Code Online (Sandbox Code Playgroud)

LLC 是 L2-cache 的别名。我的问题是如何通过 Linux 中的 perf 工具捕获 L3 缓存命中和未命中。提前致谢!

linux cpu caching perf

2
推荐指数
2
解决办法
9362
查看次数

标签 统计

caching ×1

cpu ×1

linux ×1

perf ×1