lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cjLdRDLtgSYqZW1mwCxbBe28tjUjzEDjaBcnV6W0jdQzA@mail.gmail.com>
Date:   Thu, 17 Sep 2020 10:27:41 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Stephane Eranian <eranian@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH 3/3] perf inject: Do not load map/dso when injecting build-id

On Wed, Sep 16, 2020 at 5:24 PM Jiri Olsa <jolsa@...hat.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@...hat.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@...gle.com>
> > > > Signed-off-by: Namhyung Kim <namhyung@...nel.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

Thanks
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ