Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7151242imm; Tue, 28 Aug 2018 07:13:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbTOXPDu6rDcVbIKFjDLPNfJ9eLFev6vmPmGXZc9DP8FR1dis5xTQOeyifJPyshHnbD3n6M X-Received: by 2002:a62:2459:: with SMTP id r86-v6mr1823657pfj.31.1535465592197; Tue, 28 Aug 2018 07:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535465592; cv=none; d=google.com; s=arc-20160816; b=cosFnXiBmAuQqNgYNJSS95LOVG5LqKWO8BPtgv9UbDIlmWx49Ddv1gajcUXVAIjQjh EdR/uLBYr2bQGOb+T7qodl9W5xLNUVQvmyVDegUQABkfwt5SXhhR7MfRuWary9lMUAJZ GIqBcUGDZPKOpB9N0PJJTjz/ywqEUw9qr4SIMcHfiFLgvrD4N6dL552sVzzwUhbhMPuF HHY/gO/kAzF9WcdtxqcKjgNE81du9AWKcKJA/XgatiOyaaD4zo1AuZ+GiXG5BEFMt1sS 5ZJ61vz9Kjm15CC5LiCAUMoKgqw9e2vrWQenAnd9OMfr5DAAdKp+jV4tj+JoRqfSZrRr CnZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=wyHtBRazVQa3cmv2OBooEdQTGeGyH6zFI0mKyG7GS6w=; b=inSgu6IpDZnRPjh3neJwnO7O4ykIK3s0fwcVGBKQ5f61Kanru7VRTVmxWc/Ci14dbU iM+TxlEXQ5mDGBx6b0LkkswT0mYlwUK4hh6nSAm7SWk6YbpxIJYSheLsNvXCWK9BZ/BI 4P4WHi38fXQu4J/58ulgTmkt0U5SpyzjTgCRyc9WrN4ALM8akue2d97F3nQZP43Qs7SX JxML4d1J2JIMQhZ8hENnv52mTEqlJmACLlu4H2KFGPDdu8Wh4SUlCuC/Roz4SByGncvN zDqYXvftamAPvVxcJG/tQv+cywrAx6E5c3dtn5DmzZdtElwbhYu3GyeBQUO/rDH/+05l v2Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OL24y125; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32-v6si1065391pld.404.2018.08.28.07.12.55; Tue, 28 Aug 2018 07:13:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OL24y125; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727760AbeH1SCl (ORCPT + 99 others); Tue, 28 Aug 2018 14:02:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:44372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeH1SCl (ORCPT ); Tue, 28 Aug 2018 14:02:41 -0400 Received: from jouet.infradead.org (unknown [190.15.121.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E927C2088E; Tue, 28 Aug 2018 14:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535465450; bh=2Vb66Cwc1DOT5mJ+0KAaKy/vfKUE43ekrYhNZ2WAWfg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OL24y12537hXrQP8FhWCwv7liS1a9riOkzxLP46SvLYp8FLWYnRKjoMpbA1nOrdN/ mNOPRNL6Sm/qNCKF142DwxltGLLwt1EVsLBT2/Sq9jzrKevM1YHtlgXxKMFjxL2oPZ 5dMp5VGKUD81hcnBcGqn21RmA5Jba/ASMnsiLlho= Received: by jouet.infradead.org (Postfix, from userid 1000) id 1A376141C3F; Tue, 28 Aug 2018 11:10:47 -0300 (-03) Date: Tue, 28 Aug 2018 11:10:47 -0300 From: Arnaldo Carvalho de Melo To: Martin =?utf-8?B?TGnFoWth?= Cc: linux-perf-users@vger.kernel.org, lkml , Jiri Olsa Subject: Re: [PATCH] Properly interpret indirect call in perf annotate. Message-ID: <20180828141047.GG22309@kernel.org> References: <20180823141219.GA4766@kernel.org> <64684c59-492c-3310-a5d2-14b467602acc@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <64684c59-492c-3310-a5d2-14b467602acc@suse.cz> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Aug 27, 2018 at 11:06:21AM +0200, Martin Liška escreveu: > On 08/23/2018 04:12 PM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Aug 23, 2018 at 02:29:34PM +0200, Martin Liška escreveu: > >> The patch changes interpretation of: > >> callq *0x8(%rbx) > >> > >> from: > >> 0.26 │ → callq *8 > >> to: > >> 0.26 │ → callq *0x8(%rbx) > >> > >> in this can an address is followed by a register, thus > >> one can't parse only address. > > > > Please mention one or two functions where such sequence appears, so that > > others can reproduce your before/after more quickly, > > Sure, there's self-contained example on can compile (-O2) and test. > It's following call in test function: > > test: > .LFB1: > .cfi_startproc > movq %rdi, %rax > subq $8, %rsp > .cfi_def_cfa_offset 16 > movq %rsi, %rdi > movq %rdx, %rsi > call *8(%rax) <---- here > cmpl $1, %eax > adcl $-1, %eax > addq $8, %rsp > .cfi_def_cfa_offset 8 > ret > .cfi_endproc Here I'm getting: Samples: 2K of event 'cycles:uppp', 4000 Hz, Event count (approx.): 1808551484 test /home/acme/c/perf-callq [Percent: local period] 0.17 │ mov %rdx,-0x28(%rbp) 0.58 │ mov -0x18(%rbp),%rax 7.90 │ mov 0x8(%rax),%rax 8.67 │ mov -0x28(%rbp),%rcx │ mov -0x20(%rbp),%rdx 0.08 │ mov %rcx,%rsi 6.28 │ mov %rdx,%rdi 10.50 │ → callq *%rax 1.67 │ mov %eax,-0x4(%rbp) 11.95 │ cmpl $0x0,-0x4(%rbp) 8.14 │ ↓ je 3d │ mov -0x4(%rbp),%eax │ sub $0x1,%eax │ ↓ jmp 42 │3d: mov $0x0,%eax 7.84 │42: leaveq │ ← retq Without the patch, will check if something changes with it. - Arnaldo