From a50d11a10c2db86d7383c281d4e249d5393661e9 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Thu, 26 Feb 2015 15:54:40 +0900 Subject: perf buildid-cache: Add new buildid cache if update target is not cached Add new buildid cache if the update target file is not cached. This can happen when an old binary is replaced by new one after caching the old one. In this case, user sees his operation just failed. But it does not look straight, since user just pass the binary "path", not "build-id". ---- # ./perf buildid-cache --add ./perf (update ./perf to new binary) # ./perf buildid-cache --update ./perf ./perf wasn't in the cache # ---- This patch adds given new binary to cache if the new binary is not cached. So we'll not see the above error. ---- # ./perf buildid-cache --add ./perf (update ./perf to new binary) # ./perf buildid-cache --update ./perf # ---- Signed-off-by: Masami Hiramatsu Cc: Adrian Hunter Cc: Borislav Petkov Cc: Hemant Kumar Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150226065440.23912.1494.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/build-id.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/perf/util/build-id.h') diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index 31b3c6332a1a..2a094982f954 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h @@ -22,6 +22,7 @@ bool perf_session__read_build_ids(struct perf_session *session, bool with_hits); int perf_session__write_buildid_table(struct perf_session *session, int fd); int perf_session__cache_build_ids(struct perf_session *session); +bool build_id_cache__cached(const char *sbuild_id); int build_id_cache__add_s(const char *sbuild_id, const char *name, bool is_kallsyms, bool is_vdso); int build_id_cache__remove_s(const char *sbuild_id); -- cgit v1.2.3