lkml.org 
[lkml]   [2017]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question to perf annotate handling mov ...(%rip) instructions
On Tue, Nov 28, 2017 at 11:50:30AM -0300, Arnaldo Carvalho de Melo wrote:

SNIP

> > Function mov__parse() calls comment__symbol() which contains:
> >
> > static int comment__symbol(char *raw, char *comment, u64 *addrp, char **namep)
> > {
> > char *endptr, *name, *t;
> >
> > if (strstr(raw, "(%rip)") == NULL)
> > return 0;
> >
> > This is architecture specific and does not work for non-Intel platforms.
> >
> > I would like to fix perf annotate for s390x and above move instruction on s390x
> > is
> >
> > 655a: c0 10 00 01 9c eb larl %r1,39f30 <__gmon_start__>
> >
> > There is a need to handle PLT resolution in an architecture independent way.
> >
> > Ideas and suggestions?
>
> Some historical background there, busy now, but you seem to be on the
> right track and IIRC you already sent a patch for this, right? I'll try
> to look at it.
>
> Jiri may as well, since he worked a lot recently in this codebase, to
> refactor it some more to make it useful for annotating python code, perl
> next, other scripted languages should follow too.

so we try to parse each line out of objdump using arch specific
ops callbacks, check:

disasm_line__new
disasm_line__init_ins
dl->ins.ops->parse(...

the ops stuff are defined in:

static struct arch architectures[] = {

{
.name = "s390",
.init = s390__annotate_init,
.objdump = {
.comment_char = '#',
},
},

I'd check s390__annotate_init, there's some mechanism
of associating ops for arch and try to fit in ;-)

jirka

\
 
 \ /
  Last update: 2017-11-29 09:30    [W:0.188 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site