Re: Help in removing Oprofile
William Cohen <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <[email protected]> |
On 02/03/2017 07:43 AM, Shiva M wrote: > Hi Will, > > Thank you and Sorry for delayed response. I have enabled CONFIG_HAVE_PERF_EVENTS=y. I Forgot to mention, Oprofile I am trying to bring up on KVM virtual machine. If I build on physical server, oprofile-1.0.0 is working fine. And I can connect to running process for profiling. But If I build oprofle-1.0.0 on KVM VM, I see > > "Your kernel's Performance Events Subsystem does not support your processor type. > Please use the opcontrol command instead of operf." > > Then I tried with Oprofile-0.9.9, I see opcontrol command works, I want to connect to running process for profilng. > > Let me know if I am doing anything wrong. I saw opcontrol options, but I couldn't see to connect to running process. > > Thanks, > Shiva Hi Shiva, Running oprofile inside a kvm guest is possible in some cases on x86 machine. However, the host need to be running a newer kernel and the guest vm needs to set to the same processor type (cpuid) as the host. I don't know precisely which linux kernel version allowed access to the performance monitoring hardware, but I do know that the RHEL6 2.6.32 kernels do not. If the performance monitoring hardware isn't available to perf in the guest machine, then oprofile opcontrol using the performance counters isn't going to either. If things are setup properly in the guest you should see something like the following in the output of "dmesg|more" for the kvm guest machine: [ 0.017000] Performance Events: SandyBridge events, Intel PMU driver. [ 0.017000] core: PEBS disabled due to CPU errata, please upgrade microcode [ 0.017000] ... version: 2 [ 0.017000] ... bit width: 48 [ 0.017000] ... generic registers: 4 [ 0.017000] ... value mask: 0000ffffffffffff [ 0.017000] ... max period: 000000007fffffff [ 0.017000] ... fixed-purpose events: 3 [ 0.017000] ... event mask: 000000070000000f If the perf counter are set up then should be able to use operf within the guest machine. -Will > > > > > On Thu, Feb 2, 2017 at 1:59 AM, William Cohen <[email protected] <mailto:[email protected]>> wrote: > > On 02/01/2017 12:43 PM, Shiva M wrote: > > Hi Will, > > > > I am using Oprofile 0.9.9. I tried with Oprofile-1.0.0 but later I found kernel CPU counters were not supported. Shall I try with Oprofile-0.9.7?. I did following to build Oprofile > > > > Oprofile-0.9.9>./configure --enable-static --with-kernel-support --prefix=/home/shiva/usr > > sudo make > > make install > > DESTDIR="/home/shiva/user" > > > > > > Thanks, > > Shiva > > Hi Shiva, > > opcontrol was removed from oprofile-1.0.0, so the kernel will need to be built with CONFIG_PERF_EVENTS=y in the .config file to use oprofile-1.0.0. You might check to see if the kernel perf infrastructure works with command "perf stat true". I have used that in the past to determine whether the problem is in oprofile or in the kernel. If it works oprofile is the problem, if that perf command is broken then need to look at the kernel. Is the kernel built with the oprofile driver (CONFIG_OPROFILE=m? If not opcontrol won't work. Another thing to keep in mind is that some newer processors might not be recognized by the oprofile driver. I would encourage you to use the oprofile perf interface with operf rather than the opcontrol interface. > > When things fail it would be helpful to include the specific error messages in the dicussion to better diagnose the reason for the failure. > > -Will > > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot