aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/build-id.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-11-07 08:57:56 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-11-19 10:33:46 -0500
commit73c5d224b4514575abe0dd89b43adbde937429c3 (patch)
tree779f3f233e33e3d05553fead865c8ea261389b59 /tools/perf/util/build-id.c
parent2565711fb7d7c28e0cd93c8971b520d1b10b857c (diff)
perf build-id: Move disable_buildid_cache() to util/build-id.c
Also move static variable no_buildid_cache and check it in the perf_session_cache_build_ids(). Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Hemant Kumar <hemant@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Pekka Enberg <penberg@iki.fi> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Cc: systemtap@sourceware.org Link: http://lkml.kernel.org/r/1415368677-3794-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r--tools/perf/util/build-id.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index dd2a3e52ada1..e8d79e5bfaf7 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -18,6 +18,9 @@
18#include "header.h" 18#include "header.h"
19#include "vdso.h" 19#include "vdso.h"
20 20
21
22static bool no_buildid_cache;
23
21int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, 24int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused,
22 union perf_event *event, 25 union perf_event *event,
23 struct perf_sample *sample, 26 struct perf_sample *sample,
@@ -251,6 +254,11 @@ int dsos__hit_all(struct perf_session *session)
251 return 0; 254 return 0;
252} 255}
253 256
257void disable_buildid_cache(void)
258{
259 no_buildid_cache = true;
260}
261
254int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, 262int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
255 const char *name, bool is_kallsyms, bool is_vdso) 263 const char *name, bool is_kallsyms, bool is_vdso)
256{ 264{
@@ -404,6 +412,9 @@ int perf_session__cache_build_ids(struct perf_session *session)
404 int ret; 412 int ret;
405 char debugdir[PATH_MAX]; 413 char debugdir[PATH_MAX];
406 414
415 if (no_buildid_cache)
416 return 0;
417
407 snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir); 418 snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir);
408 419
409 if (mkdir(debugdir, 0755) != 0 && errno != EEXIST) 420 if (mkdir(debugdir, 0755) != 0 && errno != EEXIST)