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?
4

1 回答 1

2

在运行 oprofile 之前,您应该检查您的系统是否存在看门狗。watchdog/nmi_watchdog 向 perf 子系统注册,这将阻止 oprofile 工作。您可能必须使用以下命令停止看门狗/NMI 看门狗以释放计数器 0:

echo "0" | sudo tee /proc/sys/kernel/watchdog

或者

echo "0" | sudo tee/proc/sys/kernel/nmi_watchdog

于 2015-07-06T11:47:57.153 回答