All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Nick Gasson <nick.gasson@arm.com>, Jiri Olsa <jolsa@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf jit: Fix inaccurate DWARF line table
Date: Fri, 29 May 2020 13:02:25 -0300	[thread overview]
Message-ID: <20200529160225.GB537@kernel.org> (raw)
In-Reply-To: <CAP-5=fWCLq+2xjViJaYxFs9b=3BxSvKmVAdv6xX3re8AoBLHWg@mail.gmail.com>

Em Thu, May 28, 2020 at 12:44:56AM -0700, Ian Rogers escreveu:
> On Wed, May 27, 2020 at 10:19 PM Nick Gasson <nick.gasson@arm.com> wrote:
> >
> > Fix an issue where addresses in the DWARF line table are offset by
> > -0x40 (GEN_ELF_TEXT_OFFSET). This can be seen with `objdump -S` on the
> > ELF files after perf inject.
> 
> Without too much knowledge this looks good to me. The original code
> came from oprofile's jit support:
> https://sourceforge.net/p/oprofile/oprofile/ci/master/tree/opjitconv/debug_line.c#l325
> 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied and added your comment,

- Arnaldo
 
> > Signed-off-by: Nick Gasson <nick.gasson@arm.com>
> > ---
> >  tools/perf/util/genelf_debug.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/util/genelf_debug.c b/tools/perf/util/genelf_debug.c
> > index 30e9f618f6cd..dd40683bd4c0 100644
> > --- a/tools/perf/util/genelf_debug.c
> > +++ b/tools/perf/util/genelf_debug.c
> > @@ -342,7 +342,7 @@ static void emit_lineno_info(struct buffer_ext *be,
> >          */
> >
> >         /* start state of the state machine we take care of */
> > -       unsigned long last_vma = code_addr;
> > +       unsigned long last_vma = 0;
> >         char const  *cur_filename = NULL;
> >         unsigned long cur_file_idx = 0;
> >         int last_line = 1;
> > @@ -473,7 +473,7 @@ jit_process_debug_info(uint64_t code_addr,
> >                 ent = debug_entry_next(ent);
> >         }
> >         add_compilation_unit(di, buffer_ext_size(dl));
> > -       add_debug_line(dl, debug, nr_debug_entries, 0);
> > +       add_debug_line(dl, debug, nr_debug_entries, GEN_ELF_TEXT_OFFSET);
> >         add_debug_abbrev(da);
> >         if (0) buffer_ext_dump(da, "abbrev");
> >
> > --
> > 2.26.2
> >

-- 

- Arnaldo

      reply	other threads:[~2020-05-29 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  5:19 [PATCH] perf jit: Fix inaccurate DWARF line table Nick Gasson
2020-05-28  7:44 ` Ian Rogers
2020-05-29 16:02   ` Arnaldo Carvalho de Melo [this message]

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=20200529160225.GB537@kernel.org \
    --to=acme@kernel.org \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick.gasson@arm.com \
    --cc=peterz@infradead.org \
    /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.