Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbcD1Wub (ORCPT ); Thu, 28 Apr 2016 18:50:31 -0400 Received: from mail.kernel.org ([198.145.29.136]:36792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbcD1Wua (ORCPT ); Thu, 28 Apr 2016 18:50:30 -0400 Date: Fri, 29 Apr 2016 07:50:24 +0900 From: Masami Hiramatsu To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , , Peter Zijlstra , Ingo Molnar , Hemant Kumar , Ananth N Mavinakayanahalli Subject: Re: [PATCH perf/core v5 02/15] perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildid Message-Id: <20160429075024.1fe53f104c0e256180dc9589@kernel.org> In-Reply-To: <20160428012223.GA15055@sejong.aot.lge.com> References: <20160427183701.23446.15293.stgit@devbox> <20160427183723.23446.47139.stgit@devbox> <20160428012223.GA15055@sejong.aot.lge.com> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2110 Lines: 61 On Thu, 28 Apr 2016 10:22:23 +0900 Namhyung Kim wrote: > Hi Masami, > > On Thu, Apr 28, 2016 at 03:37:23AM +0900, Masami Hiramatsu wrote: > > From: Masami Hiramatsu > > > > 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 > > Signed-off-by: Masami Hiramatsu > > --- > > 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