由于一个恼人的错误,我在我的系统上运行 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 documentation .还安装了内核调试信息以生成适当的 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?
最佳答案
在运行 oprofile 之前,您应该检查您的系统是否存在看门狗。 watchdog/nmi_watchdog 向 perf 子系统注册,这将阻止 oprofile 工作。 您可能必须使用以下命令停止看门狗/NMI 看门狗以释放计数器 0:
回显“0” | sudo tee/proc/sys/kernel/watchdog
或
回显“0” | sudo tee/proc/sys/kernel/nmi_watchdog
关于linux - O 配置文件错误 : Failed to open profile device: Device or resource busy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22071808/