[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160429075024.1fe53f104c0e256180dc9589@kernel.org>
Date: Fri, 29 Apr 2016 07:50:24 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
<linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Hemant Kumar <hemant@...ux.vnet.ibm.com>,
Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>
Subject: Re: [PATCH perf/core v5 02/15] perf-buildid-cache: Use
path/to/bin/buildid/elf instead of path/to/bin/buildid
On Thu, 28 Apr 2016 10:22:23 +0900
Namhyung Kim <namhyung@...nel.org> wrote:
> Hi Masami,
>
> On Thu, Apr 28, 2016 at 03:37:23AM +0900, Masami Hiramatsu wrote:
> > From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> >
> > Use path/to/bin/buildid/elf instead of path/to/bin/buildid
> > to store corresponding elf binary.
> > This also stores vdso in buildid/vdso, kallsyms in buildid/kallsyms.
> >
> > Note that the existing caches are not updated until user adds
> > or updates the cache. Anyway, if there is the old style build-id
> > cache it falls back to use it. (IOW, it is backward compatible)
> >
> > Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> > ---
> > Changes in v5:
> > - Support old style buildid caches.
> > ---
> > tools/perf/util/build-id.c | 80 ++++++++++++++++++++++++++++++++++----------
> > tools/perf/util/dso.h | 5 +++
> > tools/perf/util/symbol.c | 15 ++++++--
> > 3 files changed, 76 insertions(+), 24 deletions(-)
> >
> > diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> > index b6ecf87..b035483 100644
> > --- a/tools/perf/util/build-id.c
> > +++ b/tools/perf/util/build-id.c
> > @@ -144,7 +144,8 @@ static int asnprintf(char **strp, size_t size, const char *fmt, ...)
> > return ret;
> > }
> >
> > -static char *build_id__filename(const char *sbuild_id, char *bf, size_t size)
> > +static char *build_id_cache__linkname(const char *sbuild_id, char *bf,
> > + size_t size)
> > {
> > char *tmp = bf;
> > int ret = asnprintf(&bf, size, "%s/.build-id/%.2s/%s", buildid_dir,
> > @@ -154,15 +155,45 @@ static char *build_id__filename(const char *sbuild_id, char *bf, size_t size)
> > return bf;
> > }
> >
> > +static bool __is_regular_file(const char *pathname)
> > +{
> > + struct stat sb;
> > + return stat(pathname, &sb) == 0 && S_ISREG(sb.st_mode);
> > +}
>
> It looks like that the is_regular_file() is already in the
> util/util.c
Nice catch!!
OK, it should be used.
Thanks!
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists