diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-01-09 05:16:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-12 10:42:08 -0500 |
commit | 34b7b0f95d41d2351a080e774d71085171db90e6 (patch) | |
tree | 065cfa3b53e86cd17ba2b4b13fc0179e58bd9fe4 /tools/perf/builtin-report.c | |
parent | 090cff3eae8f02395009972d01b5dfdb95bcc327 (diff) |
perf tools: Fallback to srcdir/Documentation/tips.txt
Some people don't install perf, but just use compiled version in the
source. Fallback to lookup the source directory for those poor guys. :)
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1452334589-8782-4-git-send-email-namhyung@kernel.org
[ Make perf_tip() return NULL for ENOENT, making the fallback to really take place ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index d5a42ee12529..2bf537f190a0 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "util/tool.h" | 28 | #include "util/tool.h" |
29 | 29 | ||
30 | #include <subcmd/parse-options.h> | 30 | #include <subcmd/parse-options.h> |
31 | #include <subcmd/exec-cmd.h> | ||
31 | #include "util/parse-events.h" | 32 | #include "util/parse-events.h" |
32 | 33 | ||
33 | #include "util/thread.h" | 34 | #include "util/thread.h" |
@@ -433,7 +434,14 @@ static int report__browse_hists(struct report *rep) | |||
433 | int ret; | 434 | int ret; |
434 | struct perf_session *session = rep->session; | 435 | struct perf_session *session = rep->session; |
435 | struct perf_evlist *evlist = session->evlist; | 436 | struct perf_evlist *evlist = session->evlist; |
436 | const char *help = perf_tip(TIPDIR); | 437 | const char *help = perf_tip(system_path(TIPDIR)); |
438 | |||
439 | if (help == NULL) { | ||
440 | /* fallback for people who don't install perf ;-) */ | ||
441 | help = perf_tip(DOCDIR); | ||
442 | if (help == NULL) | ||
443 | help = "Cannot load tips.txt file, please install perf!"; | ||
444 | } | ||
437 | 445 | ||
438 | switch (use_browser) { | 446 | switch (use_browser) { |
439 | case 1: | 447 | case 1: |