Oprofile 错误: 打开性能分析设备失败: 设备或资源忙

4

我在我的系统上运行oprofile时遇到了一个非常烦人的错误,让我很困扰:

$ sudo opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux
$ sudo opcontrol --start
ATTENTION: Use of opcontrol is discouraged.  Please see the man page for operf.
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Reading module info.
Failed to open profile device: Device or resource busy
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog

任何熟悉 Oprofile 的人都会注意到,我正在使用正确的命令序列来调用服务。这直接来自于Fedora文档。内核调试信息也已安装以生成适当的 vmlinux 文件。但即使将此文件的位置传递给 oprofile,也没有任何变化:
$ sudo opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/3.12.11-201.fc19.x86_64/vmlinux
$ sudo opcontrol --start
ATTENTION: Use of opcontrol is discouraged.  Please see the man page for operf.
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Reading module info.
Failed to open profile device: Device or resource busy
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog

此外,指定位置没有日志文件。我已经尝试了几种其他解决方案,包括重新安装、删除守护进程以及在不对内核进行分析的情况下运行。

  • 为什么设备忙碌而没有oprofile进程在运行?
  • 为什么没有写入日志文件?
  • 我需要更改什么才能运行oprofile?
1个回答

2
在运行oprofile之前,您应该检查系统是否存在看门狗。 watchdog / nmi_watchdog会向perf子系统注册,这会阻止oprofile的工作。您可能需要停止watchdog / NMI watchdog以释放计数器0,使用以下命令: echo "0" | sudo tee /proc/sys/kernel/watchdog 或者 echo "0" | sudo tee /proc/sys/kernel/nmi_watchdog

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接