[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-21cfc5e10395eba795c0610cf3cf7f0a4f6f33ff@git.kernel.org>
Date: Thu, 22 May 2014 05:24:27 -0700
From: tip-bot for Michael Lentine <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, eranian@...gle.com, hpa@...or.com,
mingo@...nel.org, jolsa@...nel.org, mlentine@...gle.com,
tglx@...utronix.de
Subject: [tip:perf/core] perf tools: Add cat as fallback pager
Commit-ID: 21cfc5e10395eba795c0610cf3cf7f0a4f6f33ff
Gitweb: http://git.kernel.org/tip/21cfc5e10395eba795c0610cf3cf7f0a4f6f33ff
Author: Michael Lentine <mlentine@...gle.com>
AuthorDate: Tue, 20 May 2014 11:48:49 +0200
Committer: Jiri Olsa <jolsa@...nel.org>
CommitDate: Wed, 21 May 2014 11:48:33 +0200
perf tools: Add cat as fallback pager
This patch adds a fallback to cat for the pager. This is useful
on environments, such as Android, where less does not exist.
It is better to default to cat than to abort.
Signed-off-by: Michael Lentine <mlentine@...gle.com>
Reviewed-by: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/r/1400579330-5043-2-git-send-email-eranian@google.com
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/util/pager.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
index 3322b84..31ee02d 100644
--- a/tools/perf/util/pager.c
+++ b/tools/perf/util/pager.c
@@ -57,13 +57,13 @@ void setup_pager(void)
}
if (!pager)
pager = getenv("PAGER");
- if (!pager) {
- if (!access("/usr/bin/pager", X_OK))
- pager = "/usr/bin/pager";
- }
+ if (!(pager || access("/usr/bin/pager", X_OK)))
+ pager = "/usr/bin/pager";
+ if (!(pager || access("/usr/bin/less", X_OK)))
+ pager = "/usr/bin/less";
if (!pager)
- pager = "less";
- else if (!*pager || !strcmp(pager, "cat"))
+ pager = "cat";
+ if (!*pager || !strcmp(pager, "cat"))
return;
spawned_pager = 1; /* means we are emitting to terminal */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists