* [PATCH] Perf: Use /usr/bin/pager if available for perf pager
@ 2012-05-29 10:35 Avik Sil
2012-05-29 10:45 ` Alan Cox
2012-06-06 7:00 ` [tip:perf/urgent] perf tools: Fix pager on minimal-install embedded systems tip-bot for Avik Sil
0 siblings, 2 replies; 4+ messages in thread
From: Avik Sil @ 2012-05-29 10:35 UTC (permalink / raw)
To: a.p.zijlstra, paulus, mingo, acme; +Cc: linux-kernel
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>
---
| 4 ++++
1 file changed, 4 insertions(+)
--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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Perf: Use /usr/bin/pager if available for perf pager
2012-05-29 10:35 [PATCH] Perf: Use /usr/bin/pager if available for perf pager Avik Sil
@ 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
1 sibling, 1 reply; 4+ messages in thread
From: Alan Cox @ 2012-05-29 10:45 UTC (permalink / raw)
To: Avik Sil; +Cc: a.p.zijlstra, paulus, mingo, acme, linux-kernel
On Tue, 29 May 2012 16:05:25 +0530
Avik Sil <avik.sil@linaro.org> wrote:
> 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";
> + }
What is "portable" about /usr/bin/pager ? and what is wrong with just
doing
export PAGER=/usr/bin/pager
Alan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Perf: Use /usr/bin/pager if available for perf pager
2012-05-29 10:45 ` Alan Cox
@ 2012-05-29 11:10 ` Avik Sil
0 siblings, 0 replies; 4+ messages in thread
From: Avik Sil @ 2012-05-29 11:10 UTC (permalink / raw)
To: Alan Cox; +Cc: a.p.zijlstra, paulus, mingo, acme, linux-kernel
Hi Alan,
On Tuesday 29 May 2012 04:15 PM, Alan Cox wrote:
> On Tue, 29 May 2012 16:05:25 +0530
> Avik Sil<avik.sil@linaro.org> wrote:
>
>> 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";
>> + }
>
> What is "portable" about /usr/bin/pager ? and what is wrong with just
> doing
>
> export PAGER=/usr/bin/pager
>
This patch basically avoids explicitly setting PAGER=/usr/bin/pager
before running say 'perf list' on the system where less is not installed.
Regards,
Avik
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/urgent] perf tools: Fix pager on minimal-install embedded systems
2012-05-29 10:35 [PATCH] Perf: Use /usr/bin/pager if available for perf pager Avik Sil
2012-05-29 10:45 ` Alan Cox
@ 2012-06-06 7:00 ` tip-bot for Avik Sil
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Avik Sil @ 2012-06-06 7:00 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, avik.sil,
tglx
Commit-ID: ea1b3ebac9a1c72c4362c784b4ed069a938a4ddb
Gitweb: http://git.kernel.org/tip/ea1b3ebac9a1c72c4362c784b4ed069a938a4ddb
Author: Avik Sil <avik.sil@linaro.org>
AuthorDate: Tue, 29 May 2012 16:05:25 +0530
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 30 May 2012 15:10:39 -0300
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>
---
| 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
--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"))
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-06 7:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-29 10:35 [PATCH] Perf: Use /usr/bin/pager if available for perf pager Avik Sil
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox