linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Ian Rogers <irogers@google.com>
Subject: Re: [PATCH 3/3] perf inject: Do not load map/dso when injecting build-id
Date: Thu, 17 Sep 2020 10:01:51 +0200	[thread overview]
Message-ID: <20200917080151.GA2411168@krava> (raw)
In-Reply-To: <CAM9d7cjLdRDLtgSYqZW1mwCxbBe28tjUjzEDjaBcnV6W0jdQzA@mail.gmail.com>

On Thu, Sep 17, 2020 at 10:27:41AM +0900, Namhyung Kim wrote:
> On Wed, Sep 16, 2020 at 5:24 PM Jiri Olsa <jolsa@redhat.com> wrote:
> >
> > On Tue, Sep 15, 2020 at 11:55:34PM +0900, Namhyung Kim wrote:
> > > On Tue, Sep 15, 2020 at 7:05 PM Jiri Olsa <jolsa@redhat.com> wrote:
> > > >
> > > > On Mon, Sep 14, 2020 at 11:18:59PM +0900, Namhyung Kim wrote:
> > > > > No need to load symbols in a DSO when injecting build-id.  I guess the
> > > > > reason was to check the DSO is a special file like anon files.  Use
> > > > > some helper functions in map.c to check them before reading build-id.
> > > > > Also pass sample event's cpumode to a new build-id event.
> > > > >
> > > > > Original-patch-by: Stephane Eranian <eranian@google.com>
> > > > > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > > > > ---
> > > > >  tools/perf/builtin-inject.c | 30 ++++++++++--------------------
> > > > >  tools/perf/util/map.c       | 17 +----------------
> > > > >  tools/perf/util/map.h       | 14 ++++++++++++++
> > > > >  3 files changed, 25 insertions(+), 36 deletions(-)
> > > > >
> > > > > diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> > > > > index a2804d906d2a..6d4e6833efed 100644
> > > > > --- a/tools/perf/builtin-inject.c
> > > > > +++ b/tools/perf/builtin-inject.c
> > > > > @@ -436,21 +436,22 @@ static int dso__read_build_id(struct dso *dso)
> > > > >  }
> > > > >
> > > > >  static int dso__inject_build_id(struct dso *dso, struct perf_tool *tool,
> > > > > -                             struct machine *machine)
> > > > > +                             struct machine *machine, u8 cpumode)
> > > > >  {
> > > > > -     u16 misc = PERF_RECORD_MISC_USER;
> > > > >       int err;
> > > > >
> > > > > +     if (is_anon_memory(dso->long_name))
> > > > > +             return 0;
> > > > > +     if (is_no_dso_memory(dso->long_name))
> > > > > +             return 0;
> > > >
> > > > should we check for vdso as well? I don't think it has build id
> > >
> > > I don't know.. But I guess there's no reason it shouldn't?
> >
> > I haven't checked, it's just I always saw only zeros for vdso build ids
> 
> I found this in arch/x86/entry/vdso/Makefile.  It seems to have one..
> 
> quiet_cmd_vdso = VDSO    $@
>       cmd_vdso = $(LD) -nostdlib -o $@ \
>                $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
>                -T $(filter %.lds,$^) $(filter %.o,$^) && \
>          sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
> 
> VDSO_LDFLAGS = -shared --hash-style=both --build-id \
>     $(call ld-option, --eh-frame-hdr) -Bsymbolic

I see, I'll check why I'm getting zeros

thanks,
jirka


  reply	other threads:[~2020-09-17  8:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 14:18 [PATCH 1/3] perf inject: Add missing callbacks in perf_tool Namhyung Kim
2020-09-14 14:18 ` [PATCH 2/3] perf inject: Enter namespace when reading build-id Namhyung Kim
2020-09-14 14:18 ` [PATCH 3/3] perf inject: Do not load map/dso when injecting build-id Namhyung Kim
2020-09-15 10:05   ` Jiri Olsa
2020-09-15 14:55     ` Namhyung Kim
2020-09-16  8:24       ` Jiri Olsa
2020-09-17  1:27         ` Namhyung Kim
2020-09-17  8:01           ` Jiri Olsa [this message]
2020-09-17  1:31     ` Namhyung Kim

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=20200917080151.GA2411168@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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 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).