Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432906

Re: [RFC 3/6] perf annotate: Enable cross arch annotate

From Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC 3/6] perf annotate: Enable cross arch annotate
Date 2016-06-28 13:50 +0200
Message-ID <rOZGG-6ug-25@gated-at.bofh.it> (permalink)
References <rNxWa-7AL-11@gated-at.bofh.it> <rNxWa-7AL-35@gated-at.bofh.it> <rOImt-3d4-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On Monday 27 June 2016 10:46 PM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Jun 24, 2016 at 05:23:57PM +0530, Ravi Bangoria escreveu:
>> Change current data structures and function to enable cross arch annotate
>> and add support for x86 and arm instructions.
>>
>> Current implementation does not contain logic of recording on one arch
>> and annotating on other. This remote annotate is partially possible with
>> current implementation for x86 (or may be arm as well) only. But, to make
>> remote annotation work properly, all architecture instruction tables need
>> to be included in the perf binary. And while annotating, look for
>> instruction table where perf.data was recorded.

...

>>   
>> +static struct arch_instructions {
>> +	const char *arch;
>> +	int	   nmemb;
>> +	struct ins *instructions;
>> +	struct ins *(*ins__find)(const char *);
> Why do we need arch specific find functions? Why not pass the
> instructions pointer to it, just like you did with ins__sort().
>
> Probably it is not needed to be global, you just pick the right
> instructions table + its ARRAY_SIZE and pass it around, again, like you
> did in ins__sort().
>
> - Arnaldo

Thanks Arnaldo for suggestion.

To determine arch in ins__find, I need to pass 'arch' till ins__find and 
which
requires changes in definition of many functions. So, I thought about global
var.

Anyway, I've prepared a patch as you suggested and sent it as a [PATCH].
Please review it.

-Ravi

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC 0/6] perf annotate: Enable cross arch annotate Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-24 14:00 +0200
  [RFC 4/6] perf annotate: generalize handling of ret instructions Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-24 14:00 +0200
    Re: [RFC 4/6] perf annotate: generalize handling of ret instructions Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 19:40 +0200
    [tip:perf/core] perf annotate: Generalize handling of 'ret'  instructions "tip-bot for Naveen N. Rao" <tipbot@zytor.com> - 2016-06-29 11:50 +0200
  [RFC 5/6] perf annotate: add powerpc support Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-24 14:00 +0200
  [RFC 2/6] perf annotate: Define macro for arch names Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-24 14:00 +0200
  [RFC 1/6] perf: Remove unused hist_entry__annotate function Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-24 14:00 +0200
    Re: [RFC 1/6] perf: Remove unused hist_entry__annotate function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 19:40 +0200
    [tip:perf/core] perf annotate: Remove unused hist_entry__annotate  function tip-bot for Ravi Bangoria <tipbot@zytor.com> - 2016-06-29 11:50 +0200
  [RFC 3/6] perf annotate: Enable cross arch annotate Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-24 14:00 +0200
    Re: [RFC 3/6] perf annotate: Enable cross arch annotate Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-27 19:20 +0200
      Re: [RFC 3/6] perf annotate: Enable cross arch annotate Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-06-28 13:50 +0200

csiph-web