摘要:是否perf lock配置pthread_mutex?
详情:
该工具perf有一个选项perf lock。手册页说:
You can analyze various lock behaviours and statistics with this perf lock command.
'perf lock record <command>' records lock events
between start and end <command>. And this command
produces the file "perf.data" which contains tracing
results of lock events.
'perf lock trace' shows raw lock events.
'perf lock report' reports statistical data.
但是当我尝试运行时,perf lock record我收到一条错误消息:invalid or unsupported event: 'lock:lock_acquire'. 我看了看,似乎错误可能是因为我的内核没有用CONFIG_LOCKDEPor编译CONFIG_LOCK_STAT。
我的问题是:是否perf lock报告与用户空间锁(如 pthread_mutex)或仅内核锁相关的事件?我对主要在用户空间中运行的分析应用程序更感兴趣。我认为 perf 中的这个选项看起来很有趣,但由于我无法在不编译(或获取)新内核的情况下运行它,所以我有兴趣在尝试之前更好地了解它的作用。