Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156AbdIMJUX (ORCPT ); Wed, 13 Sep 2017 05:20:23 -0400 Received: from mga11.intel.com ([192.55.52.93]:15722 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbdIMJUV (ORCPT ); Wed, 13 Sep 2017 05:20:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,387,1500966000"; d="asc'?scan'208";a="150785940" Date: Wed, 13 Sep 2017 17:14:09 +0800 From: "Du, Changbin" To: Arnaldo Carvalho de Melo Cc: "Du, Changbin" , peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: Does perf-annotate work correctly? Message-ID: <20170913091408.GA9625@intel.com> References: <20170912101035.GA21638@intel.com> <20170912143350.GA3452@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <20170912143350.GA3452@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7384 Lines: 169 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Here is another example which may be easy to analyse. I beleve that somethi= ng wrong in parsing objdump output. The 'test %esi,%esi' is not of 'if (unlikely(error))', but 'if (!idtv_inf= o_valid)'. perf annotate of function vmx_complete_interrupts(): vmx_complete_interrupts /lib/modules/4.13.0+/kernel/arch/x86/kvm/kvm-intel= =2Eko Percent=E2=94=82 mov 0x4590(%rdi),%esi = =E2=96=92 =E2=94=82 vmx_cancel_injection(): = =E2=96=92 =E2=94=82 vmcs_read32(VM_ENTRY_= INTR_INFO_FIELD), =E2=96=92 =E2=94=82 VM_ENTRY_INSTRUCTION_= LEN, =E2=96=92 =E2=94=82 VM_ENTRY_EXCEPTION_ER= ROR_CODE); =E2=96=92 =E2=94=82 = =E2=96=92 =E2=94=82 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); = =E2=96=92 =E2=94=82 } = =E2=96=92 =E2=94=82 movb $0x0,0x32c8(%rdi) = =E2=96=92 =E2=94=82 __vmx_complete_interrupts(): = =E2=96=92 =E2=94=82 movb $0x0,0x1a7c(%rdi) = =E2=96=92 =E2=94=82 movb $0x0,0x1a88(%rdi) = =E2=96=92 =E2=94=82 __vmcs_writel(): = =E2=96=92 =E2=94=82 u8 error; = =E2=96=92 =E2=94=82 = =E2=96=92 =E2=94=82 asm volatile (__ex(ASM_VMX_VMWRITE_RAX_RDX) "; = setna %0" =E2=96=92 =E2=94=82 : "=3Dq"(error) : "a"(value), "d= "(field) : "cc"); =E2=96=92 =E2=94=82 if (unlikely(error)) = =E2=96=92 =E2=94=82 vmwrite_error(field, value); = =E2=96=92 0.02 =E2=94=82 test %esi,%esi = =E2=96=92 =E2=94=82 =E2=86=93 js 25 = =E2=96=92 99.98 =E2=94=82 =E2=86=90 retq = =E2=96=92 =E2=94=8225: push %rbp = =E2=96=92 =E2=94=82 mov $0x440a,%ecx = =E2=96=92 =E2=94=82 mov $0x440c,%edx = =E2=96=92 =E2=94=82 vmx_complete_interrupts(): = =E2=97=86 =E2=94=82 break; = =E2=96=92 =E2=94=82 } = =E2=96=92 =E2=94=82 } = =E2=96=92 =E2=94=82 = =E2=96=92 =E2=94=82 static void vmx_complete_interrupts(struct vcpu_vmx *vm= x) =E2=96=92 =E2=94=82 { = =E2=96=92 =E2=94=82 mov %rsp,%rbp = =E2=96=92 =E2=94=82 =E2=86=92 callq __vmx_complete_interrupts.part.64 = =E2=96=92 =E2=94=82 __vmx_complete_interrupts(&vmx->vcpu, vmx->idt_= vectoring_info, =E2=96=92 =E2=94=82 pop %rbp = =E2=96=92 =E2=94=82 =E2=86=90 retq = =E2=96=92 GDB disassable: (gdb) disassemble /s vmx_complete_interrupts Dump of assembler code for function vmx_complete_interrupts: arch/x86/kvm/vmx.c: 8917 { 0x0000000000007110 <+0>: callq 0x7115 8918 __vmx_complete_interrupts(&vmx->vcpu, vmx->idt_vectoring_in= fo, 0x0000000000007115 <+5>: mov 0x4590(%rdi),%esi 8873 vcpu->arch.nmi_injected =3D false; 0x000000000000711b <+11>: movb $0x0,0x32c8(%rdi) arch/x86/kvm/x86.h: 14 vcpu->arch.exception.pending =3D false; 0x0000000000007122 <+18>: movb $0x0,0x1a7c(%rdi) 15 } 16 17 static inline void kvm_queue_interrupt(struct kvm_vcpu *vcpu, u8 ve= ctor, 18 bool soft) 19 { 20 vcpu->arch.interrupt.pending =3D true; 21 vcpu->arch.interrupt.soft =3D soft; 22 vcpu->arch.interrupt.nr =3D vector; 23 } 24 25 static inline void kvm_clear_interrupt_queue(struct kvm_vcpu *vcpu) 26 { 27 vcpu->arch.interrupt.pending =3D false; 0x0000000000007129 <+25>: movb $0x0,0x1a88(%rdi) arch/x86/kvm/vmx.c: 8877 if (!idtv_info_valid) 0x0000000000007130 <+32>: test %esi,%esi 0x0000000000007132 <+34>: js 0x7135 8919 VM_EXIT_INSTRUCTION_LEN, 8920 IDT_VECTORING_ERROR_CODE); 8921 } 0x0000000000007134 <+36>: retq 8917 { 0x0000000000007135 <+37>: push %rbp 0x0000000000007136 <+38>: mov $0x440a,%ecx 0x000000000000713b <+43>: mov $0x440c,%edx ---Type to continue, or q to quit--- 0x0000000000007140 <+48>: mov %rsp,%rbp 0x0000000000007143 <+51>: callq 0x7000 <__vmx_complete_interrupts> 8919 VM_EXIT_INSTRUCTION_LEN, 8920 IDT_VECTORING_ERROR_CODE); 8921 } --5vNYLRcllDrimb99 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJZuPbgAAoJEAanuZwLnPNUKk0IALznvD7zDjVYqjlQ84xPMmfR hdX8bQ0eCCsjhUwSR0z25gPP5K/uRTh1y9ldKO4Gbl0Bg5/TH/4VCIs6kQbLW+zx MKQJ+mKix+c21XGccMSRXKJ7rwDfywrvEAwQnrFK7PErjF3UurlwVhlexL/ftb92 ctkep0QFmwJmcVsZMKSsxAirF2kzzgzeSUqUbA7xGgQjq49qR81ddsmSG3gt8Eb2 x4t/v6gE0lpseBP4jQw/525g+cbOqkypFoi3QwjBfdnIlfLRar8DKFhSEem8+qdK v01TVL8HZGQ8kEUJDFgDv2PZVtnI3xcTJz6P/OuPSNiIDnxZU075faJzHWWWvaI= =K1F/ -----END PGP SIGNATURE----- --5vNYLRcllDrimb99--