perf top: Use signal interface for SIGWINCH handler
tip-bot for Jiri Olsa
merge botCommit-ID: 244a1086aba97a6b673162fd6684c5c024b724db Gitweb: https://git.kernel.org/tip/244a1086aba97a6b673162fd6684c5c024b724db Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 15 Nov 2017 14:30:57 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 17 Nov 2017 12:16:24 -0300
perf top: Use signal interface for SIGWINCH handler
There's no need for SA_SIGINFO data in SIGWINCH handler, switching it to register the handler via signal interface as we do for the rest of the signals in perf top.
Signed-off-by Jiri Olsa <[email protected]>
Tested-by Ravi Bangoria <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Andi Kleen <[email protected]>
Cc David Ahern <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-top.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
tools/perf/builtin-top.c +3 -12
@@ -86,8 +86,7 @@ static void perf_top__update_print_entries(struct perf_top *top) top->print_entries = top->winsize.ws_row -HEADER_LINE_NR ; } -static void perf_top__sig_winch (int sig__maybe_unused , -siginfo_t *info__maybe_unused ,void *arg__maybe_unused ) +static void winch_sig (int sig__maybe_unused ) { resize =1 ; }
@@ -480,12 +479,8 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)case 'e' :prompt_integer (&top->print_entries,"Enter display entries (lines)" );if (top->print_entries ==0 ) { -struct sigaction act = { - .sa_sigaction = perf_top__sig_winch, - .sa_flags =SA_SIGINFO , - };perf_top__resize (top); -sigaction (SIGWINCH , &act,NULL ); +signal (SIGWINCH , winch_sig); }else {signal (SIGWINCH ,SIG_DFL ); }
@@ -1366,12 +1361,8 @@ int cmd_top(int argc, const char **argv)get_term_dimensions (&top.winsize);if (top.print_entries ==0 ) { -struct sigaction act = { - .sa_sigaction = perf_top__sig_winch, - .sa_flags =SA_SIGINFO , - };perf_top__update_print_entries (&top); -sigaction (SIGWINCH , &act,NULL ); +signal (SIGWINCH , winch_sig); } status =__cmd_top (&top);