Commit 570eda03 authored by David Carrillo-Cisneros's avatar David Carrillo-Cisneros Committed by Arnaldo Carvalho de Melo

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: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Simon Que <sque@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170412064919.92449-5-davidcc@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 9961aa66
...@@ -696,7 +696,8 @@ const char *perf_tip(const char *dirpath) ...@@ -696,7 +696,8 @@ const char *perf_tip(const char *dirpath)
tips = strlist__new("tips.txt", &conf); tips = strlist__new("tips.txt", &conf);
if (tips == NULL) 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) if (strlist__nr_entries(tips) == 0)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment