diff options
author | Jiri Olsa | 2014-08-11 10:50:02 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2014-08-13 16:14:22 +0200 |
commit | 9398c484f8abc8d287cb90f5a33dd43ac26f24ef (patch) | |
tree | d2c7eb0c70c3ffef204a8123cc88be2c41b51c24 /tools/perf/builtin-top.c | |
parent | perf top: Join the display thread on exit (diff) | |
download | kernel-qcow2-linux-9398c484f8abc8d287cb90f5a33dd43ac26f24ef.tar.gz kernel-qcow2-linux-9398c484f8abc8d287cb90f5a33dd43ac26f24ef.tar.xz kernel-qcow2-linux-9398c484f8abc8d287cb90f5a33dd43ac26f24ef.zip |
perf tools: Introduce set_term_quiet_input helper function
Adding set_term_quiet_input helper to set the terminal quiet, out from
'perf top', used in following patches in 'perf kvm'.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1407747014-18394-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 10fc7e844872..e8459e260c3b 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -580,20 +580,14 @@ static void *display_thread_tui(void *arg) static void *display_thread(void *arg) { struct pollfd stdin_poll = { .fd = 0, .events = POLLIN }; - struct termios tc, save; + struct termios save; struct perf_top *top = arg; int delay_msecs, c; - tcgetattr(0, &save); - tc = save; - tc.c_lflag &= ~(ICANON | ECHO); - tc.c_cc[VMIN] = 0; - tc.c_cc[VTIME] = 0; - pthread__unblock_sigwinch(); repeat: delay_msecs = top->delay_secs * 1000; - tcsetattr(0, TCSANOW, &tc); + set_term_quiet_input(&save); /* trash return*/ getc(stdin); |