Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587227

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

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 4/4] perf ftrace: Use pager for displaying result
Date 2017-02-24 02:30 +0100
Message-ID <tecRP-15s-1@gated-at.bofh.it> (permalink)
References <tecI9-11o-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-ftrace.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index d5b566ed7178..6087295f8827 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -195,6 +195,7 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
 	signal(SIGINT, sig_handler);
 	signal(SIGUSR1, sig_handler);
 	signal(SIGCHLD, sig_handler);
+	signal(SIGPIPE, sig_handler);
 
 	if (reset_tracing_files(ftrace) < 0)
 		goto out;
@@ -247,6 +248,8 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
 		goto out_close_fd;
 	}
 
+	setup_pager();
+
 	perf_evlist__start_workload(ftrace->evlist);
 
 	while (!done) {
-- 
2.11.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] perf ftrace: Add support for --pid option Namhyung Kim <namhyung@kernel.org> - 2017-02-24 02:20 +0100
  [PATCH 4/4] perf ftrace: Use pager for displaying result Namhyung Kim <namhyung@kernel.org> - 2017-02-24 02:30 +0100
  [PATCH 3/4] perf ftrace: Add support for -a and -C option Namhyung Kim <namhyung@kernel.org> - 2017-02-24 02:30 +0100
  Re: [PATCH 1/4] perf ftrace: Add support for --pid option Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-24 21:00 +0100

csiph-web