本文介绍了运行在虚拟机上的Linux上的oprofile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用VirtualBox运行Linux Ubuntu 10.4虚拟机。我正在尝试使用oprofile来分析虚拟机中的某个应用程序。我已经安装了oprofile 0.9.6,但我无法让它工作。当我尝试启动时,出现以下错误:
opcontrol --start
/ usr / local / bin / opcontrol:第323行:/ usr / local / bin / ophelp:无法执行二进制文件
/ usr / local / bin / opcontrol:第1483行:/ usr / local / bin / oprofiled:无法执行二进制文件
无法启动oprofiled。
检查日志文件/var/lib/oprofile/samples/oprofiled.log和内核系统日志
由于我不确定VirtualBox是否可以提供对性能计数器的访问(我在这里有疑问,所以如果你有任何指针,它会很棒),我默认oprofile为定时器中断,如下所示:
opcontrol --deinit
/ usr / local / bin / opcontrol:第323行:/ usr / local / bin / ophelp:无法执行二进制文件
卸载oprofile模块$ b $ root root @ dev-ubuntu-10:/ usr / local / bin#/ sbin / modprobe oprofile timer = 1 $ b $ root root @ dev-ubuntu-10: / usr / local / bin#opcontrol --init
但仍无法正常工作,同样的错误。甚至有可能在虚拟机中运行oprofile?
谢谢 解决方案
我过去曾尝试过类似的东西,只能使用VMware Fusion和另一个分析器,并遇到同样的问题。似乎访问性能寄存器和其他分析员需要的低级别内容在虚拟机中是不可行的。您恐怕需要一台真正的机器来进行分析。
I'm running a Linux Ubuntu 10.4 VM using VirtualBox. I'm trying to use oprofile to profile some application in the virtual machine. I've installed oprofile 0.9.6 but I cannot get it to work. When I try to start I get the following error:
opcontrol --start
/usr/local/bin/opcontrol: line 323: /usr/local/bin/ophelp: cannot execute binary file
/usr/local/bin/opcontrol: line 1483: /usr/local/bin/oprofiled: cannot execute binary file
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog
As I'm not sure if VirtualBox could provide access to the performance counters (I'm in doubt here so if you have any pointers it would be great) I defaulted oprofile to the timer interrupt like so:
opcontrol --deinit
/usr/local/bin/opcontrol: line 323: /usr/local/bin/ophelp: cannot execute binary file
Unloading oprofile module
root@dev-ubuntu-10:/usr/local/bin# /sbin/modprobe oprofile timer=1
root@dev-ubuntu-10:/usr/local/bin# opcontrol --init
But still not working and I'm getting the same error. Is it even possible to run oprofile in a VM?
Thanks
解决方案
I've tried something similar in the past, only with VMware Fusion and a different profiler, and run into the same problem. It seems that access to the performance registers and other low level stuff that profilers need is just not feasible in a VM. You'll need a real machine for profiling, I'm afraid.
这篇关于运行在虚拟机上的Linux上的oprofile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!