All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, kim.phillips@arm.com,
	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, namhyung@kernel.org, pawel.moll@arm.com,
	chris.ryder@arm.com, jolsa@kernel.org, mhiramat@kernel.org,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH v7 3/6] perf annotate: Show raw form for jump instruction with indirect target
Date: Mon, 10 Oct 2016 19:01:55 +0530	[thread overview]
Message-ID: <57FB984B.1090901@linux.vnet.ibm.com> (raw)
In-Reply-To: <20161005112701.GS7143@kernel.org>



On Wednesday 05 October 2016 04:57 PM, Arnaldo Carvalho de Melo wrote:
> Em Wed, Sep 21, 2016 at 09:17:53PM +0530, Ravi Bangoria escreveu:
>> For jump instructions that does not include target address as direct
>> operand, use raw value for that. This is needed for certain powerpc
>   "use raw value" looks vague, as the example below makes is go from
> using a value (ffffffffffffca2c) to no value at all, i.e. the output
> looks backwards from what you describe, can you instead show the
> original disassembled line from objdump, which I think is what you're
> calling "raw value" in this case?

Correct, I'm showing that only -- "original disassembled line from objdump".

There is no direct operand with bctr. It uses content of register 'ctr' as target
address.

For example, objdump output:

       100b8fd8:   add    r10,r9,r10
       100b8fdc:   mtctr  r10
       100b8fe0:   bctr

> - Arnaldo
>
>> jump instructions that use target address in a register (such as bctr,
>> btar, ...).
>>
>> Before:
>>      ld     r12,32088(r12)
>>      mtctr  r12
>>   v  bctr   ffffffffffffca2c
>>      std    r2,24(r1)
>>      addis  r12,r2,-1
>>
>> After:
>>      ld     r12,32088(r12)
>>      mtctr  r12
>>   v  bctr
>>      std    r2,24(r1)
>>      addis  r12,r2,-1
>>
>> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
>> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
>> ---
>> Changes in v7:
>>   - Added example in description
>>
>>  tools/perf/util/annotate.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
>> index 5aa72d9..1ccf26a 100644
>> --- a/tools/perf/util/annotate.c
>> +++ b/tools/perf/util/annotate.c
>> @@ -136,6 +136,9 @@ static int jump__parse(struct ins_operands *ops, struct map *map __maybe_unused)
>>  static int jump__scnprintf(struct ins *ins, char *bf, size_t size,
>>  			   struct ins_operands *ops)
>>  {
>> +	if (!ops->target.addr)
>> +		return ins__raw_scnprintf(ins, bf, size, ops);
>> +
>>  	return scnprintf(bf, size, "%-6.6s %" PRIx64, ins->name, ops->target.offset);
>>  }
>>  
>> -- 
>> 2.5.5

  reply	other threads:[~2016-10-10 13:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 15:47 [PATCH v7 0/6] perf annotate: Cross arch support + few fixes Ravi Bangoria
2016-09-21 15:47 ` [PATCH v7 1/6] perf annotate: Add cross arch annotate support Ravi Bangoria
2016-10-05 11:19   ` Arnaldo Carvalho de Melo
2016-10-10 13:26     ` Ravi Bangoria
2016-09-21 15:47 ` [PATCH v7 2/6] perf annotate: Add support for powerpc Ravi Bangoria
2016-10-05 11:22   ` Arnaldo Carvalho de Melo
2016-09-21 15:47 ` [PATCH v7 3/6] perf annotate: Show raw form for jump instruction with indirect target Ravi Bangoria
2016-10-05 11:27   ` Arnaldo Carvalho de Melo
2016-10-10 13:31     ` Ravi Bangoria [this message]
2016-09-21 15:47 ` [PATCH v7 4/6] perf annotate: Support jump instruction with target as second operand Ravi Bangoria
2016-10-05 11:28   ` Arnaldo Carvalho de Melo
2016-10-10 13:34     ` Ravi Bangoria
2016-09-21 15:47 ` [PATCH v7 5/6] perf annotate: Fix jump target outside of function address range Ravi Bangoria
2016-10-05 11:31   ` Arnaldo Carvalho de Melo
2016-10-10 13:37     ` Ravi Bangoria
2016-09-21 15:47 ` [PATCH v7 6/6] perf annotate: cross arch annotate support fixes for ARM Ravi Bangoria
2016-10-05 11:34   ` Arnaldo Carvalho de Melo
2016-10-10 13:46     ` Ravi Bangoria
2016-10-10 15:57       ` Kim Phillips
2016-09-21 19:34 ` [PATCH v7 0/6] perf annotate: Cross arch support + few fixes Kim Phillips
2016-09-22  5:18   ` Ravi Bangoria
2016-09-22 14:58     ` Kim Phillips
2016-09-27 15:28 ` Ravi Bangoria
2016-10-10 13:59 ` [PATCH] perf annotate: Cleanup arch specific stuff Ravi Bangoria
2016-10-10 16:24   ` Arnaldo Carvalho de Melo
2016-10-10 16:39     ` Naveen N. Rao
2016-10-10 16:49       ` Ravi Bangoria
2016-10-10 16:56         ` Arnaldo Carvalho de Melo
2016-10-17 14:43           ` Ravi Bangoria
2016-10-17 14:45             ` Arnaldo Carvalho de Melo
2016-10-17 14:49               ` Ravi Bangoria
2016-11-16  9:18 ` [PATCH v7 0/6] perf annotate: Cross arch support + few fixes Naveen N. Rao

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=57FB984B.1090901@linux.vnet.ibm.com \
    --to=ravi.bangoria@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=chris.ryder@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kim.phillips@arm.com \
    --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=namhyung@kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=pawel.moll@arm.com \
    --cc=peterz@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.