Shark L2 缓存分析不会采样

发布于 2024-07-24 02:26:59 字数 66 浏览 4 评论 0原文

我正在尝试使用 Shark 来检查 L2 缓存未命中情况,但它不起作用。 所有其他 Shark 采样模式都工作正常。

I'm trying to use Shark to check for L2 cache misses, but it won't work. All of the other Shark sampling modes work fine.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

决绝 2024-07-31 02:26:59

并非所有 CPU 都支持 L2 缓存未命中分析(这取决于 CPU 具有哪些性能寄存器)。

另请注意,每 N 个缓存未命中您只会获得一个样本,因此如果您的代码没有执行太多操作(即不访问未缓存的内存),那么您可能看不到任何样本。

Not all CPUs support L2 cache miss profiling (it depends on what performance registers the CPU has).

Also note that you only get a sample every N cache misses, so if your code is not doing much (i.e. not accessing uncached memory) then you may not see any samples.

漫漫岁月 2024-07-31 02:26:59

...有点晚了,但很可能,出于某种原因,Shark 没有检测到您正在使用哪个 CPU,并假设您没有适当的硬件性能计数器。

  1. 配置 -> 编辑
  2. 将视图下拉列表从简单翻转到高级
  3. 将 CPU 下拉列表从“当前(未知)”翻转到您的 CPU
  4. 启用感兴趣的性能计数器。 例如,L2_line_in。

查看英特尔架构手册(我认为#3)了解性能计数器的作用 - 不幸的是,通常没有直接的 L1/L2/LLC 未命中计数器,因此您需要其他计数器的某种组合或使用另一个计数器作为估计。

... a little late, but chances are, some reason, Shark didn't detect which CPU you are using and assumes you don't have the appropriate hardware performance counters.

  1. Config->Edit
  2. flip the View dropdown from Simple to Advanced
  3. flip the CPU dropdown from "Current (Unknown)" to your CPU
  4. Enable the performance counters of interest. E.g., L2_line_in .

Check out the Intel architecture manuals (#3 I think) for what perf counter does what -- unfortunately, there are often no direct L1/L2/LLC miss counters so you'll need some combination of other counters or use another as an estimate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文