使用perf用户界面工具和PEBS进行基于事件的采样 [英] Event-based sampling with the perf userland tool and PEBS

查看:429
本文介绍了使用perf用户界面工具和PEBS进行基于事件的采样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用perf用户界面工具进行基于事件的采样:目标是试图找出某些性能影响事件(例如分支未命中和缓存未命中)在我正在使用的较大系统上发生了什么地方.

I'm doing event-based sampling with the perf userland tool: the objective being trying to find out where certain performance-impacting events like branch misses and cache misses are occurring on a larger system I'm working on.

现在,类似

perf record -a -e branch-misses:pp -- sleep 5

完美运行:当在样本中收集IP时,由'pp'修饰符触发的PEBS计数模式确实非常准确.

works perfectly: the PEBS counting mode trigerred by the 'pp' modifier is really accurate when collecting the IP in the samples.

不幸的是,当我尝试对缓存缺失执行相同操作时,即

Unfortunately, when I try to do the same for cache-misses, i.e.

perf record -a -e cache-misses:pp -- sleep 5 # [1]

我知道

错误:sys_perf_event_open()syscall返回22(无效参数). /bin/dmesg可能会提供其他信息.

Error: sys_perf_event_open() syscall returned with 22 (Invalid argument). /bin/dmesg may provide additional information.

致命:是否未配置CONFIG_PERF_EVENTS = y内核支持?

Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

dmesg | grep "perf\|pmu"没有显示有用的AFAICT.我也很确定内核是使用CONFIG_PERF_EVENTS = y编译的,因为[1]和

dmesg | grep "perf\|pmu" shows nothing useful AFAICT. I'm also pretty sure that the kernel was compiled with CONFIG_PERF_EVENTS=y because both [1] and

perf record -a -e cache-misses -- sleep 5 # [2]

工作:[2]的问题是所收集的样本不是很准确,这会损害我的个人资料.

work : the problem with [2] being that the collected samples are not very accurate, which hurts my profiles.

关于这里可能发生什么的任何提示?

Any hints on what could be going on here?

推荐答案

事实证明,通用cache-misses映射到的特定事件不支持PEBS.一种替代方法是使用PEBS支持的 事件之一(请参阅Nehalem体系结构列表

It turns out the specific event that the generic cache-misses maps to does not support PEBS. An alternative is to use one of the events that are supported by PEBS (see the list for the Nehalem architecture here) with an appropriate mask to narrow it down. Specifically, one could use MEM_LOAD_RETIRED:LLC_MISS, even though the event doesn't seem to be accurate on all occasions.

这篇关于使用perf用户界面工具和PEBS进行基于事件的采样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆