I am trying to use oprofile as profiling tool inside a virtual machine. However, if I do
operf
I get the following error:
Your kernel's Performance Events Subsystem does not support your processor type.
Please use the opcontrol command instead of operf.
I thus tried opcontrol. I did the following as root
opcontrol --deinit
rm /root/.oprofile/daemonrc
opcontrol --init
opcontrol --start
which returned the following error
Cannot find event CPU_CLK_UNHALTED
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Cannot find event CPU_CLK_UNHALTED
According to the bug tracker ( http://sourceforge.net/p/oprofile/bugs/268/ ) what I did is already the workaround to get oprofile working in a VMware environment.
My OS is
Linux version 3.19.0-25-generic (buildd@lgw01-20) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015
Its installed in a virtual machine. The virtual machine software is VMware 7.1.1. The host OS is Mac OS X 10.10
I was having the same problem and found the solution at http://blogs.epfl.ch/category/3239 via oprofile on Linux running in a virtual machine
It seems by default when the oprofile kernel module is loaded by invoking
opcontrol --init
the timer support is not enabled.
The solution is to unload the kernel module
opcontrol --deinit
and load it manually, passing an option that enables timer support
modprobe oprofile timer=1
After doing that
opcontrol --start-daemon
worked for me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.