lkml.org 
[lkml]   [2018]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] perf buildid-cache: Warn --purge-all failures
Date
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>
---
tools/perf/builtin-buildid-cache.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 7a7403913b57..ef6b3cc8d57d 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -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);
--
2.14.3
\
 
 \ /
  Last update: 2018-05-10 06:37    [W:0.238 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site