[tip:perf/core] perf util: Hint missing file when tool tips fail to load
From: tip-bot for David Carrillo-Cisneros
Date: Mon Apr 17 2017 - 04:43:12 EST
Commit-ID: 570eda03213a216a88566c0da7bfe175832cfaa4
Gitweb: http://git.kernel.org/tip/570eda03213a216a88566c0da7bfe175832cfaa4
Author: David Carrillo-Cisneros <davidcc@xxxxxxxxxx>
AuthorDate: Tue, 11 Apr 2017 23:49:16 -0700
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Thu, 13 Apr 2017 11:52:51 -0300
perf util: Hint missing file when tool tips fail to load
Besides memory allocation failure, tips.txt may fail to load because the
file is not found (a more likely cause).
Communicate that to the user in tips failure warning.
Signed-off-by: David Carrillo-Cisneros <davidcc@xxxxxxxxxx>
Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: He Kuang <hekuang@xxxxxxxxxx>
Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Paul Turner <pjt@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Simon Que <sque@xxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/r/20170412064919.92449-5-davidcc@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index d8b45ce..6097d87 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -696,7 +696,8 @@ const char *perf_tip(const char *dirpath)
tips = strlist__new("tips.txt", &conf);
if (tips == NULL)
- return errno == ENOENT ? NULL : "Tip: get more memory! ;-p";
+ return errno == ENOENT ? NULL :
+ "Tip: check path of tips.txt or get more memory! ;-p";
if (strlist__nr_entries(tips) == 0)
goto out;