Skip to content

Commit

Permalink
perf buildid-cache: Warn --purge-all failures
Browse files Browse the repository at this point in the history
Warn perf buildid-cache --purge-all failures in non verbose mode.

Ex.:

  $ sudo chown root:root /home/ravi/.debug -R
  $ sudo chmod 700 /home/ravi/.debug/ -R
  $ ./perf buildid-cache -P
    Couldn't remove some caches. Error: Permission denied.

Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20180510043651.12189-1-ravi.bangoria@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Ravi Bangoria authored and Arnaldo Carvalho de Melo committed May 15, 2018
1 parent b3f58c8 commit d8ed87b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/perf/builtin-buildid-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,12 @@ int cmd_buildid_cache(int argc, const char **argv)
}
}

if (purge_all)
ret = build_id_cache__purge_all();
if (purge_all) {
if (build_id_cache__purge_all()) {
pr_warning("Couldn't remove some caches. Error: %s.\n",
str_error_r(errno, sbuf, sizeof(sbuf)));
}
}

if (missing_filename)
ret = build_id_cache__fprintf_missing(session, stdout);
Expand Down

0 comments on commit d8ed87b

Please sign in to comment.