[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200914204255.GX1714160@krava>
Date: Mon, 14 Sep 2020 22:42:55 +0200
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>,
"Frank Ch. Eigler" <fche@...hat.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 24/26] perf tools: Add buildid-list --store option
On Mon, Sep 14, 2020 at 03:42:55PM +0900, Namhyung Kim wrote:
> On Mon, Sep 14, 2020 at 6:05 AM Jiri Olsa <jolsa@...nel.org> wrote:
> >
> > Adding buildid-list --store option to populate
> > .debug data with build id files.
>
> Hmm.. isn't it better to add it to the buildid-cache command?
> > + * - store binary to build id database
> > + */
> > + is_kallsyms = !strcmp(machine->mmap_name, dso->short_name);
> > + build_id__sprintf(dso->build_id, sizeof(dso->build_id), sbuild_id);
> > +
> > + if (is_kallsyms) {
> > + /*
> > + * Find out if we are on the same kernel as perf.data
> > + * and keel kallsyms in that case.
> > + */
> > + path = strdup(dso->long_name);
> > + if (!path)
> > + goto out_err;
> > +
> > + err = sysfs__read_build_id("/sys/kernel/notes", &bid, sizeof(bid));
> > + if (err < 0)
> > + goto out_err;
> > + } else {
> > + struct stat st;
> > +
> > + /*
> > + * Does the file exists in the first place, if it does,
> > + * resolve path and read the build id.
> > + */
> > + if (stat(dso->long_name, &st)) {
> > + zfree(&path);
> > + goto try_download;
> > + }
> > +
> > + path = nsinfo__realpath(dso->long_name, dso->nsinfo);
> > + if (!path)
> > + goto out_err;
> > +
> > + err = filename__read_build_id(path, &bid, sizeof(bid));
>
> Is it ok to read the file out of the namespace?
right, I need to enclose the whole part into nsinfo__mountns_*
thanks,
jirka
Powered by blists - more mailing lists