From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBEF9C6FD1D for ; Tue, 28 Mar 2023 01:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232267AbjC1BlV (ORCPT ); Mon, 27 Mar 2023 21:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231987AbjC1BlU (ORCPT ); Mon, 27 Mar 2023 21:41:20 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A60AA26B3 for ; Mon, 27 Mar 2023 18:41:19 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-536a4eba107so105169977b3.19 for ; Mon, 27 Mar 2023 18:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679967679; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=GqR7zTtQQ91G+i7rdFae6kUQGU5KFoZk0zOPgnQCq6I=; b=B0Dfmb6o01HAanc4lrfMoiaVNxqL0S2uylr1cXL/LiDQbcynQSWWeWuK52OcNkqXai QT7QsiO9SEPdgRXDloU0JIN+nKU+2TmkBNosJoA5xIs1JCiGejNGO/tZOP9bZCWmIWNG 7gXaShd/TOmMs1NSBtum/P6ZzOTj7f2GCWL52s8tOnJyLnukOtdxC+Z3GPCnDLzopeBq tCPdVCa/jwQ+mkEQrsnsJf/Iboxf4nZL6EmAphMO/Mf0oWUsk6QuG+c3S2MiieBUuWuE 25edoBOZkfXGG7hBrQ7aq+V2VnCtWtCCETyg39xV6ZD3BGmJa48J1hYow60AXVKBAQ+m LHMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679967679; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GqR7zTtQQ91G+i7rdFae6kUQGU5KFoZk0zOPgnQCq6I=; b=amRa3p7XDkQXrv4oXk5FKPY/vorCjBrw31z+iKxJI5S4Z2X4aS0RHPjGlwl1zxwlDs wH/vqhgy2u6T6ATLbHjO9RNMkdEwKJwcNwC9rSmPGnbyaF0zBOpG+dzahQ0iRQMjPSOV KJ4zP55G82ZkNu+kHB56mSGgt9R25Fn8cuj7F8encnhGAEPATTjn5TQ2oOMUGFnuQdiw E+gP+Bv+nZ6D70SFLKnQMGqNcwLaQn0De0Wbtx4c4uVikRFeE5NwOLICRPps5K7vxJMS RhDbi2hG69WgwKr3WTAkaluSCL+DbU/9qiPz78T09nMDR5Z6aOyhG4I3nIPU6ZhzNJ7O bI0A== X-Gm-Message-State: AAQBX9fNYGHbiI4Y47aat8ooZkCODyIWBWO8zCb3rHxCUX5vP/bCKeHy IIT0DCfPetdgxH8qYtUa/Aa6mncFT0HM X-Google-Smtp-Source: AKy350ZQ0hlk2F8Saos9KfdCnbLkngJsg5ccYINLqQhqBFeKNhcn7HtzaZFNMEEOmc7mdPvGEpI8gXZ6j9EV X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a544:20a5:5228:d98f]) (user=irogers job=sendgmr) by 2002:a05:6902:110b:b0:b71:addc:e19c with SMTP id o11-20020a056902110b00b00b71addce19cmr6723016ybu.8.1679967678878; Mon, 27 Mar 2023 18:41:18 -0700 (PDT) Date: Mon, 27 Mar 2023 18:40:53 -0700 In-Reply-To: <20230328014058.870413-1-irogers@google.com> Message-Id: <20230328014058.870413-2-irogers@google.com> Mime-Version: 1.0 References: <20230328014058.870413-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Subject: [PATCH v1 1/6] perf ui: Move window resize signal functions From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Mathieu Poirier , Suzuki K Poulose , Kan Liang , Raul Silvera , Athira Rajeev , Ravi Bangoria , Florian Fischer , Rob Herring , Xing Zhengjun , Sean Christopherson , Chengdong Li , Denis Nikitin , "=?UTF-8?q?Martin=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Move under tools/perf/ui rather than in perf.c. This simplifies linking a main function when perf.c isn't present. Signed-off-by: Ian Rogers --- tools/perf/perf.c | 18 ------------------ tools/perf/perf.h | 2 -- tools/perf/ui/setup.c | 19 +++++++++++++++++++ tools/perf/ui/tui/setup.c | 1 - tools/perf/ui/ui.h | 3 +++ 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 82bbe0ca858b..4b1b31e78332 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -432,24 +432,6 @@ static int run_argv(int *argcp, const char ***argv) return 0; } -static void pthread__block_sigwinch(void) -{ - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGWINCH); - pthread_sigmask(SIG_BLOCK, &set, NULL); -} - -void pthread__unblock_sigwinch(void) -{ - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGWINCH); - pthread_sigmask(SIG_UNBLOCK, &set, NULL); -} - static int libperf_print(enum libperf_print_level level, const char *fmt, va_list ap) { diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 74014033df60..e21a7e15a34c 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -12,8 +12,6 @@ extern const char *input_name; extern bool perf_host, perf_guest; extern const char perf_version_string[]; -void pthread__unblock_sigwinch(void); - enum perf_affinity { PERF_AFFINITY_SYS = 0, PERF_AFFINITY_NODE, diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c index 25ded88801a3..ff800047e697 100644 --- a/tools/perf/ui/setup.c +++ b/tools/perf/ui/setup.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include #include @@ -120,3 +121,21 @@ void exit_browser(bool wait_for_ok) } mutex_destroy(&ui__lock); } + +void pthread__block_sigwinch(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGWINCH); + pthread_sigmask(SIG_BLOCK, &set, NULL); +} + +void pthread__unblock_sigwinch(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGWINCH); + pthread_sigmask(SIG_UNBLOCK, &set, NULL); +} diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c index a3b8c397c24d..c1886aa184b3 100644 --- a/tools/perf/ui/tui/setup.c +++ b/tools/perf/ui/tui/setup.c @@ -9,7 +9,6 @@ #endif #include "../../util/debug.h" -#include "../../perf.h" #include "../browser.h" #include "../helpline.h" #include "../ui.h" diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h index 99f8d2fe9bc5..d8e911205582 100644 --- a/tools/perf/ui/ui.h +++ b/tools/perf/ui/ui.h @@ -31,4 +31,7 @@ struct option; int stdio__config_color(const struct option *opt, const char *mode, int unset); +void pthread__block_sigwinch(void); +void pthread__unblock_sigwinch(void); + #endif /* _PERF_UI_H_ */ -- 2.40.0.348.gf938b09366-goog