简体   繁体   English

Oprofile错误:无法打开配置文件设备:设备或资源繁忙

[英]Oprofile Error: Failed to open profile device: Device or resource busy

I'm struggling to run oprofile on my system because of an annoying error: 由于一个恼人的错误,我正努力在我的系统上运行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

Anyone familiar with Oprofile will notice I'm using the proper sequence of commands to invoke the service. 任何熟悉Oprofile的人都会注意到我正在使用正确的命令序列来调用服务。 This comes directly from Fedora documentation . 这直接来自Fedora文档 Kernel debug information was also installed to generate the appropriate vmlinux file. 还安装了内核调试信息以生成相应的vmlinux文件。 But even after passing the location of this file to oprofile, nothing chaged: 但即使将此文件的位置传递给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

What's more is there's no log file in the specified location. 更重要的是指定位置没有日志文件。 I've tried several other solutions, including re-installation, deleting the daemon, and running without profiling the kernel. 我已经尝试了其他几种解决方案,包括重新安装,删除守护进程,以及在不分析内核的情况下运行。

  • Why is the device busy when there's no oprofile processes running? 当没有运行oprofile进程时,为什么设备会忙?
  • Why is there no log file written? 为什么没有写入日志文件?
  • What do I change so that I can run oprofile? 我有什么改变才能运行oprofile?

Before running the oprofile, you should check wether your system exists watchdog. 在运行oprofile之前,您应该检查您的系统是否存在看门狗。 watchdog/nmi_watchdog registers with the perf subsystem which will blocking oprofile from working. watchdog / nmi_watchdog向perf子系统注册,这将阻止oprofile工作。 You may have to stop the watchdog/NMI watchdog to free up counter 0 using the following: 您可能必须使用以下命令停止看门狗/ NMI看门狗以释放计数器0:

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

OR 要么

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM