diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-30 10:06:06 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-30 10:06:06 -0300 |
commit | 73ae8f85fda49410a59d7b532ce69a0b811ef6d5 (patch) | |
tree | 4ae5ef200b05642a07de6a54cbdd7ac05facd32d | |
parent | 6da80ce8c43ddda153208cbb46b75290cf566fac (diff) | |
download | op-kernel-dev-73ae8f85fda49410a59d7b532ce69a0b811ef6d5.zip op-kernel-dev-73ae8f85fda49410a59d7b532ce69a0b811ef6d5.tar.gz |
perf tui: Make CTRL+Z suspend perf
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/newt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index 28f74eb..91de99b 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c @@ -11,6 +11,7 @@ #define HAVE_LONG_LONG __GLIBC_HAVE_LONG_LONG #endif #include <slang.h> +#include <signal.h> #include <stdlib.h> #include <newt.h> #include <sys/ttydefaults.h> @@ -891,6 +892,13 @@ static struct newtPercentTreeColors { "blue", "lightgray", }; +static void newt_suspend(void *d __used) +{ + newtSuspend(); + raise(SIGTSTP); + newtResume(); +} + void setup_browser(void) { struct newtPercentTreeColors *c = &defaultPercentTreeColors; @@ -904,6 +912,7 @@ void setup_browser(void) use_browser = 1; newtInit(); newtCls(); + newtSetSuspendCallback(newt_suspend, NULL); ui_helpline__puts(" "); sltt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg); sltt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg); |