diff options
Diffstat (limited to 'tools/perf/builtin-buildid-cache.c')
-rw-r--r-- | tools/perf/builtin-buildid-cache.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index 70385756da63..77d5cae54c6a 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c | |||
@@ -285,12 +285,11 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
285 | struct str_node *pos; | 285 | struct str_node *pos; |
286 | int ret = 0; | 286 | int ret = 0; |
287 | bool force = false; | 287 | bool force = false; |
288 | char debugdir[PATH_MAX]; | ||
289 | char const *add_name_list_str = NULL, | 288 | char const *add_name_list_str = NULL, |
290 | *remove_name_list_str = NULL, | 289 | *remove_name_list_str = NULL, |
291 | *missing_filename = NULL, | 290 | *missing_filename = NULL, |
292 | *update_name_list_str = NULL, | 291 | *update_name_list_str = NULL, |
293 | *kcore_filename; | 292 | *kcore_filename = NULL; |
294 | char sbuf[STRERR_BUFSIZE]; | 293 | char sbuf[STRERR_BUFSIZE]; |
295 | 294 | ||
296 | struct perf_data_file file = { | 295 | struct perf_data_file file = { |
@@ -335,13 +334,11 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
335 | 334 | ||
336 | setup_pager(); | 335 | setup_pager(); |
337 | 336 | ||
338 | snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir); | ||
339 | |||
340 | if (add_name_list_str) { | 337 | if (add_name_list_str) { |
341 | list = strlist__new(true, add_name_list_str); | 338 | list = strlist__new(true, add_name_list_str); |
342 | if (list) { | 339 | if (list) { |
343 | strlist__for_each(pos, list) | 340 | strlist__for_each(pos, list) |
344 | if (build_id_cache__add_file(pos->s, debugdir)) { | 341 | if (build_id_cache__add_file(pos->s, buildid_dir)) { |
345 | if (errno == EEXIST) { | 342 | if (errno == EEXIST) { |
346 | pr_debug("%s already in the cache\n", | 343 | pr_debug("%s already in the cache\n", |
347 | pos->s); | 344 | pos->s); |
@@ -359,7 +356,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
359 | list = strlist__new(true, remove_name_list_str); | 356 | list = strlist__new(true, remove_name_list_str); |
360 | if (list) { | 357 | if (list) { |
361 | strlist__for_each(pos, list) | 358 | strlist__for_each(pos, list) |
362 | if (build_id_cache__remove_file(pos->s, debugdir)) { | 359 | if (build_id_cache__remove_file(pos->s, buildid_dir)) { |
363 | if (errno == ENOENT) { | 360 | if (errno == ENOENT) { |
364 | pr_debug("%s wasn't in the cache\n", | 361 | pr_debug("%s wasn't in the cache\n", |
365 | pos->s); | 362 | pos->s); |
@@ -380,7 +377,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
380 | list = strlist__new(true, update_name_list_str); | 377 | list = strlist__new(true, update_name_list_str); |
381 | if (list) { | 378 | if (list) { |
382 | strlist__for_each(pos, list) | 379 | strlist__for_each(pos, list) |
383 | if (build_id_cache__update_file(pos->s, debugdir)) { | 380 | if (build_id_cache__update_file(pos->s, buildid_dir)) { |
384 | if (errno == ENOENT) { | 381 | if (errno == ENOENT) { |
385 | pr_debug("%s wasn't in the cache\n", | 382 | pr_debug("%s wasn't in the cache\n", |
386 | pos->s); | 383 | pos->s); |
@@ -395,7 +392,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
395 | } | 392 | } |
396 | 393 | ||
397 | if (kcore_filename && | 394 | if (kcore_filename && |
398 | build_id_cache__add_kcore(kcore_filename, debugdir, force)) | 395 | build_id_cache__add_kcore(kcore_filename, buildid_dir, force)) |
399 | pr_warning("Couldn't add %s\n", kcore_filename); | 396 | pr_warning("Couldn't add %s\n", kcore_filename); |
400 | 397 | ||
401 | out: | 398 | out: |