Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf ui: Move window resize signal functions

Move under tools/perf/ui rather than in perf.c.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Chengdong Li <chengdongli@tencent.com>
Cc: Denis Nikitin <denik@chromium.org>
Cc: Florian Fischer <florian.fischer@muhq.space>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin Liška <mliska@suse.cz>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Raul Silvera <rsilvera@google.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230410162511.3055900-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
cd8ef949 760eafb2

+22 -21
-18
tools/perf/perf.c
··· 432 432 return 0; 433 433 } 434 434 435 - static void pthread__block_sigwinch(void) 436 - { 437 - sigset_t set; 438 - 439 - sigemptyset(&set); 440 - sigaddset(&set, SIGWINCH); 441 - pthread_sigmask(SIG_BLOCK, &set, NULL); 442 - } 443 - 444 - void pthread__unblock_sigwinch(void) 445 - { 446 - sigset_t set; 447 - 448 - sigemptyset(&set); 449 - sigaddset(&set, SIGWINCH); 450 - pthread_sigmask(SIG_UNBLOCK, &set, NULL); 451 - } 452 - 453 435 static int libperf_print(enum libperf_print_level level, 454 436 const char *fmt, va_list ap) 455 437 {
-2
tools/perf/perf.h
··· 12 12 extern bool perf_host, perf_guest; 13 13 extern const char perf_version_string[]; 14 14 15 - void pthread__unblock_sigwinch(void); 16 - 17 15 enum perf_affinity { 18 16 PERF_AFFINITY_SYS = 0, 19 17 PERF_AFFINITY_NODE,
+19
tools/perf/ui/setup.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <dlfcn.h> 3 + #include <signal.h> 3 4 #include <unistd.h> 4 5 5 6 #include <subcmd/pager.h> ··· 120 119 break; 121 120 } 122 121 mutex_destroy(&ui__lock); 122 + } 123 + 124 + void pthread__block_sigwinch(void) 125 + { 126 + sigset_t set; 127 + 128 + sigemptyset(&set); 129 + sigaddset(&set, SIGWINCH); 130 + pthread_sigmask(SIG_BLOCK, &set, NULL); 131 + } 132 + 133 + void pthread__unblock_sigwinch(void) 134 + { 135 + sigset_t set; 136 + 137 + sigemptyset(&set); 138 + sigaddset(&set, SIGWINCH); 139 + pthread_sigmask(SIG_UNBLOCK, &set, NULL); 123 140 }
-1
tools/perf/ui/tui/setup.c
··· 9 9 #endif 10 10 11 11 #include "../../util/debug.h" 12 - #include "../../perf.h" 13 12 #include "../browser.h" 14 13 #include "../helpline.h" 15 14 #include "../ui.h"
+3
tools/perf/ui/ui.h
··· 31 31 32 32 int stdio__config_color(const struct option *opt, const char *mode, int unset); 33 33 34 + void pthread__block_sigwinch(void); 35 + void pthread__unblock_sigwinch(void); 36 + 34 37 #endif /* _PERF_UI_H_ */