代码之家  ›  专栏  ›  技术社区  ›  celavek

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

  •  0
  • celavek  · 技术社区  · 15 年前

    我正在运行一个使用VirtualBox的Linux-ubuntu10.4虚拟机。我正在尝试使用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
    

    谢谢

    5 回复  |  直到 15 年前
        1
  •  0
  •   Paul R    15 年前

    我以前也尝试过类似的方法,只是使用了VMware Fusion和不同的探查器,但遇到了相同的问题。似乎在虚拟机中,访问性能寄存器和探查器所需的其他低级内容是不可行的。恐怕你需要一台真正的机器来分析。

        2
  •  0
  •   Employed Russian    15 年前

    此错误:

    /usr/local/bin/ophelp: cannot execute binary file
    

    通常意味着您正在尝试执行 x86_64 32位内核上的二进制文件。

    你要做什么 file usr/local/bin/ophelp uname -a

        3
  •  0
  •   Tralamazza    15 年前

    几年前,我在vmware内部运行oprofile时遇到了一些问题。我在这篇文章上写下了我的小经历 http://blogs.epfl.ch/category/3239

        4
  •  0
  •   Sumit Lubal    11 年前

    oprofile-0.9.7

    将其提取到任意位置,然后执行以下步骤:

    install it by >  1 ./configure 2. make 3. make install
    

    然后试着使用它,它工作得很好,您可能希望在VMWARE中打开虚拟CPU计数器,并在linux中禁用nmi\U监视器寄存器,因为它们可能被其他探查器使用。

        5
  •  0
  •   user1173470    10 年前

     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

    推荐文章