linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, treeze.taeung@gmail.com,
	naveen.n.rao@linux.vnet.ibm.com, markus@trippelsdorf.de,
	chris.ryder@arm.com, pawel.moll@arm.com, mhiramat@kernel.org,
	rmk+kernel@arm.linux.org.uk, jolsa@kernel.org,
	mpe@ellerman.id.au, hemant@linux.vnet.ibm.com,
	namhyung@kernel.org
Subject: Re: [PATCH v6 4/7] perf annotate: Do not ignore call instruction with indirect target
Date: Mon, 19 Sep 2016 12:44:13 -0300	[thread overview]
Message-ID: <20160919154413.GA14725@kernel.org> (raw)
In-Reply-To: <1471611578-11255-5-git-send-email-ravi.bangoria@linux.vnet.ibm.com>

Em Fri, Aug 19, 2016 at 06:29:35PM +0530, Ravi Bangoria escreveu:
> Do not ignore call instruction with indirect target when its already
> identified as a call. This is an extension of commit e8ea1561952b
> ("perf annotate: Use raw form for register indirect call instructions")
> to generalize annotation for all instructions with indirect calls.
> 
> This is needed for certain powerpc call instructions that use address
> in a register (such as bctrl, btarl, ...).
> 
> Apart from that, when kcore is used to disassemble function, all call
> instructions were ignored. This patch will fix it as a side effect by
> not ignoring them. For example,
> 
> Before (with kcore):
>        mov    %r13,%rdi
>        callq  0xffffffff811a7e70
>      ^ jmpq   64
>        mov    %gs:0x7ef41a6e(%rip),%al
> 
> After (with kcore):
>        mov    %r13,%rdi
>      > callq  0xffffffff811a7e70
>      ^ jmpq   64
>        mov    %gs:0x7ef41a6e(%rip),%al

Ok, makes sense, but then now I have the -> and can't press enter to go
to that function, in fact for the case I'm using as a test, the
vsnprintf kernel function, I get:

       │ 56:   test   %al,%al                                                                                                                                ▒
       │     ↓ je     81                                                                                                                                     ▒
       │       lea    -0x38(%rbp),%rsi                                                                                                                       ▒
       │       mov    %r15,%rdi                                                                                                                              ▒
       │     → callq  0xffffffff993e3230 

That 0xffffffff993e3230 should've been resolved to:

[root@jouet ~]# grep ffffffff993e3230 /proc/kallsyms 
ffffffff993e3230 t format_decode

Trying to investigate why it doesn't...

- Arnaldo

> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> [Suggested about 'bctrl' instruction]
> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
> ---
> Changes in v6:
>   - No change
> 
>  tools/perf/util/annotate.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index ea07588..a05423b 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -81,16 +81,12 @@ static int call__parse(struct ins_operands *ops, const char *norm_arch)
>  	return ops->target.name == NULL ? -1 : 0;
>  
>  indirect_call:
> -	tok = strchr(endptr, '(');
> -	if (tok != NULL) {
> +	tok = strchr(endptr, '*');
> +	if (tok == NULL) {
>  		ops->target.addr = 0;
>  		return 0;
>  	}
>  
> -	tok = strchr(endptr, '*');
> -	if (tok == NULL)
> -		return -1;
> -
>  	ops->target.addr = strtoull(tok + 1, NULL, 16);
>  	return 0;
>  }
> -- 
> 2.5.5

  reply	other threads:[~2016-09-19 15:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19 12:59 [PATCH v6 0/7] perf: Cross arch annotate + few miscellaneous fixes Ravi Bangoria
2016-08-19 12:59 ` [PATCH v6 1/7] perf: Define macro for normalized arch names Ravi Bangoria
2016-08-19 12:59 ` [PATCH v6 2/7] perf annotate: Add cross arch annotate support Ravi Bangoria
2016-08-22 23:01   ` Kim Phillips
2016-08-23  2:17     ` Namhyung Kim
2016-08-23 20:36       ` Kim Phillips
2016-08-26  6:21         ` Namhyung Kim
2016-08-26  7:26         ` Ravi Bangoria
2016-08-27  0:40           ` [PATCH] perf annotate: cross arch annotate support fixes for ARM Kim Phillips
2016-08-19 12:59 ` [PATCH v6 3/7] perf annotate: Add support for powerpc Ravi Bangoria
2016-09-19 15:26   ` Arnaldo Carvalho de Melo
2016-08-19 12:59 ` [PATCH v6 4/7] perf annotate: Do not ignore call instruction with indirect target Ravi Bangoria
2016-09-19 15:44   ` Arnaldo Carvalho de Melo [this message]
2016-09-20 14:35     ` Ravi Bangoria
2016-09-20 14:56       ` Arnaldo Carvalho de Melo
2016-09-20 21:43   ` [tip:perf/core] " tip-bot for Ravi Bangoria
2016-08-19 12:59 ` [PATCH v6 5/7] perf annotate: Show raw form for jump " Ravi Bangoria
2016-08-19 12:59 ` [PATCH v6 6/7] perf annotate: Support jump instruction with target as second operand Ravi Bangoria
2016-08-19 12:59 ` [PATCH v6 7/7] perf annotate: Fix jump target outside of function address range Ravi Bangoria
2016-09-07 15:39 ` [PATCH v6 0/7] perf: Cross arch annotate + few miscellaneous fixes Ravi Bangoria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160919154413.GA14725@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=chris.ryder@arm.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=markus@trippelsdorf.de \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=namhyung@kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=pawel.moll@arm.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=treeze.taeung@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).