From: Adrian Hunter Date: Mon, 11 Jul 2022 09:31:52 +0000 (+0300) Subject: perf buildid-cache: Do not require purge files to also be in the file system X-Git-Tag: v6.6.17~6870^2~135 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1fd5b7d8aed8104d5189c3d55545d67f9149bb6;p=platform%2Fkernel%2Flinux-rpi.git perf buildid-cache: Do not require purge files to also be in the file system realname() returns NULL if the file is not in the file system, but we can still remove it from the build ID cache in that case, so continue and attempt the purge with the name provided. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220711093218.10967-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 7c9f441..9e17614 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -561,14 +561,11 @@ char *build_id_cache__cachedir(const char *sbuild_id, const char *name, char *realname = (char *)name, *filename; bool slash = is_kallsyms || is_vdso; - if (!slash) { + if (!slash) realname = nsinfo__realpath(name, nsi); - if (!realname) - return NULL; - } if (asprintf(&filename, "%s%s%s%s%s", buildid_dir, slash ? "/" : "", - is_vdso ? DSO__NAME_VDSO : realname, + is_vdso ? DSO__NAME_VDSO : (realname ? realname : name), sbuild_id ? "/" : "", sbuild_id ?: "") < 0) filename = NULL;