Bug 582570 - Cannot run oprofile inside DOMU
Summary: Cannot run oprofile inside DOMU
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: oprofile
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: William Cohen
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-15 10:47 UTC by Kirby Zhou
Modified: 2013-03-11 17:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-11 17:45:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kirby Zhou 2010-04-15 10:47:23 UTC
Description of problem:

Cannot run oprofile inside DOMU

Version-Release number of selected component (if applicable):

oprofile-0.9.4-15.el5

How reproducible:

100%

Steps to Reproduce:

opcontrol --init
opcontrol --start
opcontrol --dump
  
Actual results:

]# opcontrol --init

[root@xen-727057^10.227 oprofile]# opcontrol --start
/usr/bin/opcontrol: line 1160: echo: write error: Invalid argument
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Failed to open profile device: Operation not permitted
Couldn't start oprofiled.
Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog

[root@xen-727057^10.227 oprofile]# opcontrol --dump
Unable to complete dump of oprofile data: is the oprofile daemon running?

Expected results:


Additional info:

I just want use the basic function of oprofile to profiling my program inside a DomU box.

Comment 1 William Cohen 2010-11-05 15:13:21 UTC
The performance counters are not available to profile in virtualized environments such as xen. You might be able to use the timer mode within the DomU.

If just measuring things within a domU, as root you could do the following to use the timer mode:

opcontrol --deinit 
rm -f /root/.oprofile/daemonrc
modprobe oprofile timer=1
opcontrol --reset
opcontrol --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux \
  --separate=library
opcontrol --start

This has been verified to work with oprofile-0.9.4-15.el5.

Comment 2 Frank Ch. Eigler 2013-03-11 17:45:28 UTC
Since xen did not virtualize perf counters sufficiently, the approximation in comment #1 is probably the best oprofile can do.


Note You need to log in before you can comment on or make changes to this bug.