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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201014115931.GA1382146@krava>
Date:   Wed, 14 Oct 2020 13:59:31 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
        lkml <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Michael Petlan <mpetlan@...hat.com>,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 5/9] perf tools: Pass build_id object to dso__set_build_id

On Wed, Oct 14, 2020 at 08:51:44AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Oct 13, 2020 at 09:24:37PM +0200, Jiri Olsa escreveu:
> > Passing build_id object to dso__set_build_id, so it's easier
> > to initialize dos's build id object.
> > 
> > Acked-by: Ian Rogers <irogers@...gle.com>
> > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> > ---
> >  tools/perf/util/dso.c            | 4 ++--
> >  tools/perf/util/dso.h            | 2 +-
> >  tools/perf/util/header.c         | 4 +++-
> >  tools/perf/util/symbol-minimal.c | 2 +-
> >  tools/perf/util/symbol.c         | 2 +-
> >  5 files changed, 8 insertions(+), 6 deletions(-)
> > 
> > diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
> > index 2f7f01ead9a1..4415ce83150b 100644
> > --- a/tools/perf/util/dso.c
> > +++ b/tools/perf/util/dso.c
> > @@ -1326,9 +1326,9 @@ void dso__put(struct dso *dso)
> >  		dso__delete(dso);
> >  }
> >  
> > -void dso__set_build_id(struct dso *dso, void *build_id)
> > +void dso__set_build_id(struct dso *dso, struct build_id *bid)
> >  {
> > -	memcpy(dso->bid.data, build_id, sizeof(dso->bid.data));
> > +	dso->bid = *bid;
> 
> Can't we use bid->size here?
> 
> 	dso->bid.size = bid->size;
> 	memcpy(dso->bid.data, bid->data, bid->size));
> 
> ?
> 
> Not worth it? Probably :-)

yea, I wonder compiler will do the same thing in both cases,
but I don't know ;-)

I wanted to demonstrate that it's the same object

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ