Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7149652imm; Tue, 28 Aug 2018 07:11:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZjm3rpStrelJjUixW1hN0p2+JX0NoFWUxpMVi855udY6C9FNDIoNmFuajS9uKWAi4e79K9 X-Received: by 2002:a62:83ca:: with SMTP id h193-v6mr1804268pfe.123.1535465511832; Tue, 28 Aug 2018 07:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535465511; cv=none; d=google.com; s=arc-20160816; b=gO0iEnf9ZM6fXJNu5w1lTR4WC0CuHbZ6F1vhSlhgXPUkcMEf0JAYvp0EFh86VPsBUG Tf4bJ/rgQGg6sx70qnUGtGPpdXObGnX2uyK+WDTUXTJ1jZKnATcmV9JvmsXlk5HKg42u Ywjs+HtSZW3At5im/9Rb2aG1NRwp8SbzHyVeoAEtbp40uCAXOmKjNbGWiLR3jFR5Ynwo O/r+vJs2C/x0++fAgqdGOdHuvrn11wvF2wqw0Z8dw6+WeWGq2T4oiPe6CJqJuQJf33Bv 920gTWW0ZS8v34mPGmfx9aDanIqHT1hQUdadOPVdn0+H+Urbz7a2JjonxR3522hOQ5xj 5tGw== 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=H0LrB9fGt+i2sw+/CkzJe207e0Tg5B6/vWIPpJhSBgo=; b=Jo8MCbl9NanQjsinv19ND1Ecz9PHSjoRAKhTndqOTf+t3nCDApI7/tNiWa1OZRFBAb x+Nl+FXi8FjJf7HWeWd7hJlElWs6VxWBbrY12/Tp4lpVilHNDWdoPBfT6wvavIQYHZyX OzWIKZ83sbKzIxyn4feyx2iDaw/jDpAUubvd+15hgvW5GG0kviyG490XbeJ1xhd+YXlV 3swyhFXQxrPXO2lOPSXN9DrmqswCyZp2kTxMUpVgoVqJM9tJjRlyAieYk2vblsJj3ukk 2xLb9oHu+aSZ2Cw6gKqWa80jrvFtGn1YWivSQAfvBESCA5SG65706bOmLPjB5fDsBrT9 Ttsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s6E8Aw4s; 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 i13-v6si1064927pgq.426.2018.08.28.07.11.35; Tue, 28 Aug 2018 07:11:51 -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=s6E8Aw4s; 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 S1727463AbeH1SCR (ORCPT + 99 others); Tue, 28 Aug 2018 14:02:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:43966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeH1SCR (ORCPT ); Tue, 28 Aug 2018 14:02:17 -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 638082088E; Tue, 28 Aug 2018 14:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535465426; bh=reTIp6uZkssQRfooUpG6xITPAC5UQqEdTI1gKeY3lwo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s6E8Aw4s5zzoApbXaZjG+KAg7Bl5In16e040fbvMFF5+2lM02b/fbyO7uoOt9hyt/ OACIqvpkxm42StBs3WVMHB4kLWR8uxqraV9qfYp/AAsQYyiXhEASyy4UMjYINcdHqF XSae9Hffef0D3Qsu2J6caz6QxJDbpJb21dhkqLqQ= Received: by jouet.infradead.org (Postfix, from userid 1000) id 0FDF2141C3F; Tue, 28 Aug 2018 11:10:24 -0300 (-03) Date: Tue, 28 Aug 2018 11:10:24 -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: <20180828141024.GF22309@kernel.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 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. > > Signed-off-by: Martin Liška > --- > tools/perf/util/annotate.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) Please don't send the patch as an attachment, use 'git-format-patch', I'm fixing this up this time. - Arnaldo > > diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c > index e4268b948e0e..e32ead4744bd 100644 > --- a/tools/perf/util/annotate.c > +++ b/tools/perf/util/annotate.c > @@ -246,8 +246,14 @@ static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_s > > indirect_call: > tok = strchr(endptr, '*'); > - if (tok != NULL) > - ops->target.addr = strtoull(tok + 1, NULL, 16); > + if (tok != NULL) { > + endptr++; > + > + /* Indirect call can use a non-rip register and offset: callq *0x8(%rbx). > + * Do not parse such instruction. */ > + if (strstr(endptr, "(%r") == NULL) > + ops->target.addr = strtoull(endptr, NULL, 16); > + } > goto find_target; > } > >