From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946945AbdKRIos (ORCPT ); Sat, 18 Nov 2017 03:44:48 -0500 Received: from terminus.zytor.com ([65.50.211.136]:51007 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965335AbdKRIol (ORCPT ); Sat, 18 Nov 2017 03:44:41 -0500 Date: Sat, 18 Nov 2017 00:42:15 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: dsahern@gmail.com, tglx@linutronix.de, namhyung@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com, wangnan0@huawei.com, mingo@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, ravi.bangoria@linux.vnet.ibm.com, andi@firstfloor.org Reply-To: andi@firstfloor.org, ravi.bangoria@linux.vnet.ibm.com, adrian.hunter@intel.com, jolsa@kernel.org, wangnan0@huawei.com, mingo@kernel.org, hpa@zytor.com, acme@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, dsahern@gmail.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Use signal interface for SIGWINCH handler Git-Commit-ID: 244a1086aba97a6b673162fd6684c5c024b724db X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 244a1086aba97a6b673162fd6684c5c024b724db Gitweb: https://git.kernel.org/tip/244a1086aba97a6b673162fd6684c5c024b724db Author: Jiri Olsa AuthorDate: Wed, 15 Nov 2017 14:30:57 +0100 Committer: Arnaldo Carvalho de Melo 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 Tested-by: Ravi Bangoria Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-elxp1vdnaog1scaj13cx7cu0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4cbd3dd..a29a983 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -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);