From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Measuring KVM Performance using Hardware Performance Counters Date: Sun, 02 Feb 2014 12:37:09 +0100 Message-ID: <52EE2DE5.6040007@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Xin Tong , kvm@vger.kernel.org Return-path: Received: from mail-qa0-f53.google.com ([209.85.216.53]:52093 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbaBBLhS (ORCPT ); Sun, 2 Feb 2014 06:37:18 -0500 Received: by mail-qa0-f53.google.com with SMTP id cm18so8667709qab.12 for ; Sun, 02 Feb 2014 03:37:18 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 02/02/2014 03:08, Xin Tong ha scritto: > I am getting very weird profile results by running operf on linux on > the host and profiling the a kvm virtual machine running dacapo > eclipse benchmark. I am expecting a lot of time should be spent in > the qemu-system-x86_64 as the instructions from the eclipse benchmark > would be treated as part of the qemu-system-x86_64 process, but the > results tell different. any suggestions ? Most of the time should be spent running the guest. This is in the context of process qemu-system-x86_64, but it is not running code from the qemu executable. What likely happens is that when the profiling counter expires, it causes the VM to exit before the profiling interrupt is delivered. The sample should then be associated to the kvm_intel module. 31.5% in the KVM module seems like a lot. Can you detail the results further, so that I can see the function names for kvm and kvm_intel? Paolo > > CPU_CLK_UNHALTED % Module > Symbol/Functions > 1054 31.49 /kvm > /kvm > 645 19.27 /kvm_intel > /kvm_intel > 248 7.41 > /home/xtong/qemu-kvm-1.2.0/install/bin/qemu-system-x86_64 > /home/xtong/qemu-kvm-1.2.0/install/bin/qemu-system-x86_64 > 215 6.42 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > native_write_msr_safe > 101 3.02 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > native_read_msr_safe > 93 2.78 /lib/x86_64-linux-gnu/libc-2.15.so > /lib/x86_64-linux-gnu/libc-2.15.so > 77 2.30 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 > /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 > 65 1.94 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > __srcu_read_lock > 48 1.43 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > __srcu_read_unlock > 40 1.20 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > native_load_tr_desc > 29 0.87 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > __ticket_spin_lock > 25 0.75 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > guest_exit > 21 0.63 /usr/lib/debug/boot/vmlinux-3.11.0-13-generic > native_load_gdt > ... > Thank you.