perf util: Hint missing file when tool tips fail to load
authorDavid Carrillo-Cisneros <davidcc@google.com>
Wed, 12 Apr 2017 06:49:16 +0000 (23:49 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 13 Apr 2017 14:52:51 +0000 (11:52 -0300)
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@google.com>
Acked-by: Jiri 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/util.c

index d8b45cea54d08233c3d743cc38c6c0ef7af90328..6097d87429e2b2d14f19c34e5249434eb9b1c65a 100644 (file)
@@ -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;