diff options
Diffstat (limited to 'tools/perf/util/header.c')
| -rw-r--r-- | tools/perf/util/header.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 1f62435f96c2..d7e67b167ea3 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include "symbol.h" | 16 | #include "symbol.h" |
| 17 | #include "debug.h" | 17 | #include "debug.h" |
| 18 | 18 | ||
| 19 | static bool no_buildid_cache = false; | ||
| 20 | |||
| 19 | /* | 21 | /* |
| 20 | * Create new perf.data header attribute: | 22 | * Create new perf.data header attribute: |
| 21 | */ | 23 | */ |
| @@ -385,8 +387,7 @@ static int perf_session__cache_build_ids(struct perf_session *self) | |||
| 385 | int ret; | 387 | int ret; |
| 386 | char debugdir[PATH_MAX]; | 388 | char debugdir[PATH_MAX]; |
| 387 | 389 | ||
| 388 | snprintf(debugdir, sizeof(debugdir), "%s/%s", getenv("HOME"), | 390 | snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir); |
| 389 | DEBUG_CACHE_DIR); | ||
| 390 | 391 | ||
| 391 | if (mkdir(debugdir, 0755) != 0 && errno != EEXIST) | 392 | if (mkdir(debugdir, 0755) != 0 && errno != EEXIST) |
| 392 | return -1; | 393 | return -1; |
| @@ -471,7 +472,8 @@ static int perf_header__adds_write(struct perf_header *self, int fd) | |||
| 471 | } | 472 | } |
| 472 | buildid_sec->size = lseek(fd, 0, SEEK_CUR) - | 473 | buildid_sec->size = lseek(fd, 0, SEEK_CUR) - |
| 473 | buildid_sec->offset; | 474 | buildid_sec->offset; |
| 474 | perf_session__cache_build_ids(session); | 475 | if (!no_buildid_cache) |
| 476 | perf_session__cache_build_ids(session); | ||
| 475 | } | 477 | } |
| 476 | 478 | ||
| 477 | lseek(fd, sec_start, SEEK_SET); | 479 | lseek(fd, sec_start, SEEK_SET); |
| @@ -1190,3 +1192,8 @@ int event__process_build_id(event_t *self, | |||
| 1190 | session); | 1192 | session); |
| 1191 | return 0; | 1193 | return 0; |
| 1192 | } | 1194 | } |
| 1195 | |||
| 1196 | void disable_buildid_cache(void) | ||
| 1197 | { | ||
| 1198 | no_buildid_cache = true; | ||
| 1199 | } | ||
