Kirby,

Are you sure you are in full out KVM?  I ask because your other thread
titles KVM but your hostnames are set to Xen.  I am going to assume
you are doing Xen and share you some notes while getting oprofile to
work in full virt Xen.  Not sure if these applies to KVM but you can
try.

The full virtualization might be confusing oprofile kernel module.
Virtualization doesn't allow access to the performance monitoring
hardware.  Oprofile identifies the process based on the cpuid (similar
to method used for /proc/cpuinfo), based on the cpuid oprofile assumes
that it can use the performance monitoring hardware.

Try using "opcontrol --deinit; modprobe oprofile timer=1" to force
oprofile to use the timer mechanism rather  than the performance
monitoring hardware.

# opcontrol --deinit; modprobe oprofile timer=1
# opcontrol --start --vmlinux=/usr/lib/debug/lib/modules/`uname
-r`/vmlinux --separate=library

Need to stop oprofile, and unload the module ("opcontrol --deinit"),
the modprobe makes sure that oprofile doesn't pay attention to the
cpuid.

1) Assuming I do 'opcontrol --dump; oparchive --output-directory
/output/path'.  It should start saving data, correct?

After doing the modprobe you will need do the "oprofile --setup ..."
and "oprofile -start" to record data. Then you can do the experiment
write the data and then oparchive it.

Note that "opcontrol --shutdown" will automatically do the "opcontrol --dump"

hope this helps.

~rp




On Thu, Aug 12, 2010 at 4:38 AM, Kirby Zhou <[email protected]> wrote:
> oprofile works incorrectly under KVM guest?
>
> If I do 'opcontrol --dump' outside the KVM guest, the output of opreport
> inside the KVM guest will change.
>
> #Guest
> [...@djt_10_192 ~]# opcontrol --start; opcontrol --reset; ./a.out 1 10000;
> opcontrol --dump; opreport
> Profiler running.
> Signalling daemon... done
> crc:a4580383
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
>          TIMER:0|
>  samples|      %|
> ------------------
>    13698 81.8084 no-vmlinux
>     2417 14.4350 libcrypto.so.0.9.8e
>      473  2.8249 libz.so.1.2.3
>       58  0.3464 a.out
>       42  0.2508 libc-2.5.so
>       34  0.2031 ld-2.5.so
>       14  0.0836 bash
>        4  0.0239 gawk
>        2  0.0119 oprofiled
>        1  0.0060 GBK.so
>        1  0.0060 libstdc++.so.6.0.8
>
> #Host
> [...@djt_10_48 ~]# opcontrol --dump
> #Guest
> [...@djt_10_192 ~]# opreport
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
>          TIMER:0|
>  samples|      %|
> ------------------
>   336162 98.9203 no-vmlinux
>     2422  0.7127 libcrypto.so.0.9.8e
>      473  0.1392 libz.so.1.2.3
>      335  0.0986 opreport
>      156  0.0459 libc-2.5.so
>       94  0.0277 ld-2.5.so
>       58  0.0171 a.out
>       34  0.0100 bash
>       34  0.0100 oprofiled
>       33  0.0097 libstdc++.so.6.0.8
>       15  0.0044 gawk
>        6  0.0018 less
>        4  0.0012 GBK.so
>        2 5.9e-04 grep
>        1 2.9e-04 sed
>        1 2.9e-04 libm-2.5.so
>        1 2.9e-04 sshd
> [...@djt_10_192 ~]#
>
> Regards,
>   Kirby Zhou
>   from   SOHU-RD   +86-10-6272-8261
>
>
>
> _______________________________________________
> rhelv5-list mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/rhelv5-list
>

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to