From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@elte.hu, acme@redhat.com,
jolsa@redhat.com, namhyung@kernel.org,
Michael Lentine <mlentine@google.com>
Subject: [PATCH 1/2] perf tools: add cat as fallback pager
Date: Sat, 17 May 2014 01:15:55 +0200 [thread overview]
Message-ID: <1400282156-4661-2-git-send-email-eranian@google.com> (raw)
In-Reply-To: <1400282156-4661-1-git-send-email-eranian@google.com>
From: Michael Lentine <mlentine@google.com>
This patch adds a fallback to cat for the pager. This is useful
on environmnents, such as Android, where less does not exist.
It is better to default to cat than to abort.
Reviewed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Michael Lentine <mlentine@google.com>
---
| 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
index 3322b84..5feec3d 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)
+ if (!(pager || access("/usr/bin/pager", X_OK)))
+ pager = "/usr/bin/pager";
+ if (!(pager || access("/usr/bin/less", X_OK)))
pager = "less";
- else if (!*pager || !strcmp(pager, "cat"))
+ if (!pager)
+ pager = "cat";
+ if (!*pager || !strcmp(pager, "cat"))
return;
spawned_pager = 1; /* means we are emitting to terminal */
--
1.9.1.423.g4596e3a
next prev parent reply other threads:[~2014-05-16 23:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 23:15 [PATCH 0/2] perf tools: improve perf support on Android Stephane Eranian
2014-05-16 23:15 ` Stephane Eranian [this message]
2014-05-16 23:15 ` [PATCH 2/2] perf tools: add automatic remapping of Android libraries Stephane Eranian
-- strict thread matches above, loose matches on Subject: below --
2014-05-16 23:14 [PATCH 0/2] perf tools: improve perf support on Android Stephane Eranian
2014-05-16 23:14 ` [PATCH 1/2] perf tools: add cat as fallback pager Stephane Eranian
2014-05-17 1:55 ` David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400282156-4661-2-git-send-email-eranian@google.com \
--to=eranian@google.com \
--cc=acme@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mlentine@google.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome