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: <20201113111011.GF753418@krava>
Date:   Fri, 13 Nov 2020 12:10:11 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Michael Petlan <mpetlan@...hat.com>,
        Song Liu <songliubraving@...com>,
        Ian Rogers <irogers@...gle.com>,
        Stephane Eranian <eranian@...gle.com>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH 15/24] perf tools: Synthesize build id for
 kernel/modules/tasks

On Fri, Nov 13, 2020 at 01:32:22PM +0900, Namhyung Kim wrote:
> On Mon, Nov 09, 2020 at 10:54:06PM +0100, Jiri Olsa wrote:
> > Adding build id to synthesized mmap2 events for
> > everything - kernel/modules/tasks.
> > 
> > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> > ---
> >  tools/perf/util/synthetic-events.c | 33 ++++++++++++++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
> > index a18ae502d765..a9d5d1ff2cad 100644
> > --- a/tools/perf/util/synthetic-events.c
> > +++ b/tools/perf/util/synthetic-events.c
> > @@ -347,6 +347,32 @@ static bool read_proc_maps_line(struct io *io, __u64 *start, __u64 *end,
> >  	}
> >  }
> >  
> > +static void perf_record_mmap2__read_build_id(struct perf_record_mmap2 *event,
> > +					     bool is_kernel)
> > +{
> > +	struct build_id bid;
> > +	int rc;
> > +
> > +	if (is_kernel)
> > +		rc = sysfs__read_build_id("/sys/kernel/notes", &bid);
> > +	else
> > +		rc = filename__read_build_id(event->filename, &bid) > 0 ? 0 : -1;
> > +
> > +	if (rc == 0) {
> > +		memcpy(event->build_id, bid.data, sizeof(bid.data));
> > +		event->build_id_size = (u8) bid.size;
> > +	} else {
> > +		if (event->filename[0] == '/') {
> > +			pr_debug2("Failed to read build ID for %s\n",
> > +				  event->filename);
> > +		}
> > +		memset(event->build_id, 0x0, sizeof(event->build_id));
> 
> Likewise, we should not set the misc bit here IMHO.

right, will implement the fallback

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ