diff options
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r-- | tools/perf/util/build-id.c | 11 |
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 | |||
22 | static bool no_buildid_cache; | ||
23 | |||
21 | int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, | 24 | int 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 | ||
257 | void disable_buildid_cache(void) | ||
258 | { | ||
259 | no_buildid_cache = true; | ||
260 | } | ||
261 | |||
254 | int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, | 262 | int 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) |