diff options
author | Avik Sil <avik.sil@linaro.org> | 2012-05-29 06:35:25 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-30 14:10:39 -0400 |
commit | ea1b3ebac9a1c72c4362c784b4ed069a938a4ddb (patch) | |
tree | 0498214d437020780a87f80af0b718736409f1b8 /tools/perf | |
parent | f1439c315b328bbb3f7f6fdd814a7057f9e130d5 (diff) |
perf tools: Fix pager on minimal-install embedded systems
Some Distributions may lack "less" package being included by default,
e.g., Linaro nano rootfs. In those cases use the portable "pager"
command instead of "less".
Signed-off-by: Avik Sil <avik.sil@linaro.org>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338287725-26382-1-git-send-email-avik.sil@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/pager.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c index 1915de20dcac..3322b8446e89 100644 --- a/tools/perf/util/pager.c +++ b/tools/perf/util/pager.c | |||
@@ -57,6 +57,10 @@ void setup_pager(void) | |||
57 | } | 57 | } |
58 | if (!pager) | 58 | if (!pager) |
59 | pager = getenv("PAGER"); | 59 | pager = getenv("PAGER"); |
60 | if (!pager) { | ||
61 | if (!access("/usr/bin/pager", X_OK)) | ||
62 | pager = "/usr/bin/pager"; | ||
63 | } | ||
60 | if (!pager) | 64 | if (!pager) |
61 | pager = "less"; | 65 | pager = "less"; |
62 | else if (!*pager || !strcmp(pager, "cat")) | 66 | else if (!*pager || !strcmp(pager, "cat")) |