在虚拟机中运行的Linux上的oprofile

我正在使用VirtualBox运行Linux Ubuntu 10.4 VM。我正在尝试使用oprofile来配置虚拟机中的某些应用程序。我已经安装了oprofile 0.9.6,但我无法让它工作。当我尝试启动时,我收到以下错误:
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
因为我不确定VirtualBox是否可以提供对性能计数器的访问(我在这里有疑问,所以如果你有任何指针它会很棒)我将oprofile默认为定时器中断,如下所示:
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
但仍然没有工作,我得到同样的错误。甚至可以在VM中运行oprofile吗? 谢谢     
已邀请:
我曾经尝试过类似的东西,只有VMware Fusion和不同的分析器,并遇到同样的问题。似乎访问性能寄存器和分析器需要的其他低级别的东西在VM中是不可行的。我担心,你需要一台真正的机器进行分析。     
这个错误:
/usr/local/bin/ophelp: cannot execute binary file
通常意味着您尝试在32位内核上执行
x86_64
二进制文件。
file usr/local/bin/ophelp
uname -a
打印什么?     
几年前,我在vmware中运行oprofile时遇到了一些问题。我在这篇文章http://blogs.epfl.ch/category/3239上写了我的小经验     
您可以尝试安装oprofile-0.9.7等旧版本 在任何地方提取它然后按照步骤
install it by >  1 ./configure 2. make 3. make install
然后尝试使用它工作正常您可能想要打开VMWARE中的​​虚拟CPU计数器并禁用Linux中的nmi_watchdog寄存器,因为它们可能被其他分析器使用。     
使用HPC(硬件性能计数器)需要硬件支持,尝试在vbox中安装cpuid,你会看到
 Architecture Performance Monitoring Features (0xa/ebx):
  core cycle event not available           = false
  instruction retired event not available  = false
  reference cycles event not available     = false
  last-level cache ref event not available = false
  last-level cache miss event not avail    = false
  branch inst retired event not available  = false
  branch mispred retired event not avail   = false
架构性能监控功能(0xa / edx):       固定计数器的数量= 0x0(0)       固定计数器的位宽= 0x0(0) 似乎只有Vmware和KVM可以模拟PMU单元,而不是VBOX     

要回复问题请先登录注册