From: Arnaldo Carvalho de Melo Date: Fri, 30 Jul 2010 13:06:06 +0000 (-0300) Subject: perf tui: Make CTRL+Z suspend perf X-Git-Tag: v2.6.36-rc1~41^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73ae8f85fda49410a59d7b532ce69a0b811ef6d5;p=profile%2Fivi%2Fkernel-x86-ivi.git perf tui: Make CTRL+Z suspend perf Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Stephane Eranian LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- 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 +#include #include #include #include @@ -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);