[PATCH 13/19] perf ftrace: Use pager for displaying result

From: Namhyung Kim
Date: Wed Jun 26 2013 - 03:15:51 EST


From: Namhyung Kim <namhyung.kim@xxxxxxx>

It's convenient to use pager when seeing many lines of result.

Note that setup_pager() should be called after perf_evlist__
prepare_workload() since they can interfere each other regarding
shared stdio streams.

Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/builtin-ftrace.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 1e28dc7e9743..8bb2604517cc 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -227,6 +227,7 @@ static int do_ftrace_live(struct perf_ftrace *ftrace)
signal(SIGINT, sig_handler);
signal(SIGUSR1, sig_handler);
signal(SIGCHLD, sig_handler);
+ signal(SIGPIPE, sig_handler);

if (setup_tracing_files(ftrace) < 0)
goto out_reset;
@@ -1415,6 +1416,8 @@ __cmd_ftrace_live(struct perf_ftrace *ftrace, int argc, const char **argv)
argv, false, true) < 0)
goto out_maps;

+ setup_pager();
+
ret = do_ftrace_live(ftrace);

out_maps:
@@ -1536,6 +1539,8 @@ __cmd_ftrace_show(struct perf_ftrace *ftrace, int argc, const char **argv)
if (ftrace->dirname == NULL)
ftrace->dirname = DEFAULT_DIRNAME;

+ setup_pager();
+
ret = do_ftrace_show(ftrace);

perf_evlist__delete_maps(ftrace->evlist);
@@ -1597,6 +1602,7 @@ __cmd_ftrace_report(struct perf_ftrace *ftrace, int argc, const char **argv)
perf_hpp__column_enable(PERF_HPP__OVERHEAD);
perf_hpp__init();

+ setup_pager();
setup_sorting();

symbol_conf.exclude_other = false;
--
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/