diff options
| author | Andi Kleen <[email protected]> | 2020-05-22 02:09:14 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2020-05-28 13:03:28 +0000 |
| commit | 8c3e05c827ef687215723680862ebd2d431dee49 (patch) | |
| tree | 0335afd20648ba3b393a4813a2d8ac1fa7da80da /tools/perf/builtin-script.c | |
| parent | perf metricgroup: Remove unnecessary ',' from events (diff) | |
| download | kernel-8c3e05c827ef687215723680862ebd2d431dee49.tar.gz kernel-8c3e05c827ef687215723680862ebd2d431dee49.zip | |
perf script: Don't force less for non tty output with --xed
--xed currently forces less. When piping the output to other scripts
this can waste a lot of CPU time because less is rather slow.
I've seen it using up a full core on its own in a pipeline.
Only force less when the output is actually a terminal.
Signed-off-by: Andi Kleen <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/builtin-script.c')
| -rw-r--r-- | tools/perf/builtin-script.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 4c0837efaceb..2810d5a7096b 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -3301,7 +3301,10 @@ static int parse_xed(const struct option *opt __maybe_unused, const char *str __maybe_unused, int unset __maybe_unused) { - force_pager("xed -F insn: -A -64 | less"); + if (isatty(1)) + force_pager("xed -F insn: -A -64 | less"); + else + force_pager("xed -F insn: -A -64"); return 0; } |
