From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v2 00/11] KVM in-guest performance monitoring Date: Thu, 16 Jun 2011 09:18:14 -0600 Message-ID: <4DFA1EB6.6050708@cisco.com> References: <1307972106-2468-1-git-send-email-avi@redhat.com> <4DF66B1A.6060606@cisco.com> <4DF71DA3.2080300@redhat.com> <4DF7972F.3040103@cisco.com> <4DF79941.9050705@siemens.com> <4DF79B6F.10102@cisco.com> <4DF79EFE.1050201@cisco.com> <4DF7A436.8090308@cisco.com> <4DF873FD.6040903@redhat.com> <4DF8A82F.5090900@cisco.com> <4DF8B1F8.6030502@redhat.com> <4DF8D8FE.2080808@cisco.com> <4DF8DD87.8040905@redhat.com> <4DF8E328.6070708@cisco.com> <4DFA0AC4.9050702@redhat.com> <4DFA0E56.70301@cisco.com> <1308236915.13240.66.camel@twins> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo To: Peter Zijlstra Return-path: Received: from sj-iport-2.cisco.com ([171.71.176.71]:30113 "EHLO sj-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756675Ab1FPPSQ (ORCPT ); Thu, 16 Jun 2011 11:18:16 -0400 In-Reply-To: <1308236915.13240.66.camel@twins> Sender: kvm-owner@vger.kernel.org List-ID: On 06/16/2011 09:08 AM, Peter Zijlstra wrote: > On Thu, 2011-06-16 at 08:08 -0600, David Ahern wrote: >> Command: >> perf stat -e instructions openssl speed aes >> >> Guest: >> 135,522,189,056 instructions # 0.00 insns per cycle >> >> >> Host: >> 346,082,922,185 instructions # 0.00 insns per cycle > > How does: perf stat -e instructions:u openssl speed aes, compare? I think the problem is that perf stat in the guest introduces significant overhead. I ran perf-record in the host on the VM pid while running 'perf stat openssl speed aes' in the guest. perf-report on that data shows: 18.06% 9226 [k] arch_local_irq_enable | |--99.77%-- kvm_arch_vcpu_ioctl_run | kvm_vcpu_ioctl | do_vfs_ioctl | sys_ioctl | system_call_fastpath | __GI___ioctl | 0x10100000002 --0.23%-- [...] and then perf-annotate on kvm_arch_vcpu_ioctl_run shows : vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); 21.47 : 1613a: 48 8b 3b mov (%rbx),%rdi David