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.
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.
Since xen did not virtualize perf counters sufficiently, the approximation in comment #1 is probably the best oprofile can do.