On 11/26/2011 05:09 AM, Chengjian Wen wrote: > Hi All, > > I find a problem when I test the IPC of the kvm vcpu. My question is > that when the thread is a vcpu, whether the instructions we get from > perf stat includes > the part spending on the time vcpu had enter vmx or else it only > includes the time vm-exit. It includes both. Linux 3.2 will allow the option of selecting one or the other. > I run NPB benchmark in the KVM which owns 4 vcpu and I use the > following command to get the IPC information of vcpu thread. > thread 3117 is the qemu-io thread, 3118,3119,3120,3121 are the vcpu > thread. I am curious that the why the IPC is so slow when the guest is > running a cpu-intensive application. > > Here below is some output of my tests. > > 1." perf stat -t 3121" run for 1 s , then get the following result. > [root@wenfedora hcfs]# perf stat -t 3121 > ^C > Performance counter stats for thread id '3121': > > 977.620697 task-clock-msecs # 0.999 CPUs > 103 context-switches # 0.000 M/sec > 0 CPU-migrations # 0.000 M/sec > 0 page-faults # 0.000 M/sec > 3005826152 cycles # 3074.634 M/sec > 825271483 instructions # 0.275 IPC > 140665441 branches # 143.885 M/sec > 11731765 branch-misses # 8.340 % > 256884 cache-references # 0.263 M/sec > 3102 cache-misses # 0.003 M/sec > > 0.978720288 seconds time elapsed Try perf stat -e kvm:kvm_exit -e instructions -e cycles -e branches -e branch-misses to see if you have many exits. What's the output of the same test when the benchmark is running on the host? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html