Skip to content

Commit

Permalink
perf tools: Fix pager on minimal-install embedded systems
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avik Sil authored and Arnaldo Carvalho de Melo committed May 30, 2012
1 parent f1439c3 commit ea1b3eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/perf/util/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ void setup_pager(void)
}
if (!pager)
pager = getenv("PAGER");
if (!pager) {
if (!access("/usr/bin/pager", X_OK))
pager = "/usr/bin/pager";
}
if (!pager)
pager = "less";
else if (!*pager || !strcmp(pager, "cat"))
Expand Down

0 comments on commit ea1b3eb

Please sign in to comment.