linux - O 配置文件错误 : Failed to open profile device: Device or resource busy

标签 linux profiling fedora oprofile

由于一个恼人的错误,我在我的系统上运行 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/

相关文章:

linux - 登录后运行 bash 脚本

c - 堆栈中奇怪的指针位置

linux - 用于分析结果的基于文本的查看器

linux - 允许在 SELinux 中具有不同上下文的不同文件上使用自定义上下文的守护进程进行操作

更新后docker不工作

c - 执行快速排序时使用 GCC 编译器在 C 中出现段错误

c - 除非在使用输出重定向时调用显式 fflush 函数,否则线程不会给出输出

linux - 如何合并不同服务器上的目录?

java - @Profile 与 @ConditionalOnProperty

php - PHP 的 'profiler with visualization' 和 `full backtrace visualization` ?