mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avik Sil <avik.sil@linaro.org>
To: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
	acme@ghostprotocols.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Perf: Use /usr/bin/pager if available for perf pager
Date: Tue, 29 May 2012 16:05:25 +0530	[thread overview]
Message-ID: <1338287725-26382-1-git-send-email-avik.sil@linaro.org> (raw)

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>
---
 tools/perf/util/pager.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
index 1915de2..3322b84 100644
--- a/tools/perf/util/pager.c
+++ b/tools/perf/util/pager.c
@@ -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"))
-- 
1.7.9.5


             reply	other threads:[~2012-05-29 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29 10:35 Avik Sil [this message]
2012-05-29 10:45 ` Alan Cox
2012-05-29 11:10   ` Avik Sil
2012-06-06  7:00 ` [tip:perf/urgent] perf tools: Fix pager on minimal-install embedded systems tip-bot for Avik Sil

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=1338287725-26382-1-git-send-email-avik.sil@linaro.org \
    --to=avik.sil@linaro.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®