From patchwork Mon Apr 10 16:25:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206510 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67465C77B70 for ; Mon, 10 Apr 2023 16:26:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A5/KScZHii5JxSBZWBoG+IayBeENlkP4XxpLpiGRo5A=; b=486PDgx/0Ff1JB 0JKyRIBsF5bjfYhJt1m02GHowMsEIizMbMd2NsYZGrc2KcAEcakhfPRZaEfsfvuHZxz2uf1FXEf5Y Q6Vi4xP37qnJP8zjLLTrXLEIWpuL7GO4ZS/JNVOaX8Jx14mfPWjRVb/U00P2NpBWbwdn4T1+3sssP Alvaft5o+aiQGiWRuV/Dywz9YZkwu8/cNFJ5gwbnnBDKTuy3KzhTBdj43iC71tu2Xefvk4pQjXn8e 1IieiGs7JwbF7grYfsiusJY5pPpOVnjSmyf42urlW57OtQlHLxoz+iQWtc/9NP8037hmFMRF4Fl5r l14KC+MacJVEPNRmWJnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluKs-00FXNQ-0Z; Mon, 10 Apr 2023 16:25:42 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluKp-00FXMH-0E for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:25:40 +0000 Received: by mail-yb1-xb49.google.com with SMTP id c193-20020a25c0ca000000b00b868826cdfeso24362709ybf.0 for ; Mon, 10 Apr 2023 09:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143937; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=z4x5msFieB8TY6JG6tSeqo1a6qx829CImWZ+KZOZZfE=; b=e53R/pdxxmjNLL/YdPjB7kGGvR9zVdxHM44CxcOKHkGiOemqQwrY/UqI000B2tfd+M 1m2C3T+iKURD70k3cvjezTvZ/prcAhpHU6yhdD2aXN/7vaX6fPzRznIIgg4n2d00zhuv k4v8xTJG58hSOzGkzxx2ZkxqFsPGMdcHqs9JY6oFgcwG5tW0oPbSo9csGJaA0MkfH6px 5JyrL1lUN9zaJjZupkDcLYPZc3MVAbB1ejP5vIdqUDgBYM7aehy4ZKhZF/tTsTtplv6C fjpwi2GebeO5zMY4Ge65sGf0yn8GfGKhHrdUjM26M86LassaGijU8bOhGCkMZCLI9Jz7 nS3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143937; 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=z4x5msFieB8TY6JG6tSeqo1a6qx829CImWZ+KZOZZfE=; b=rkcVt6jdJWtwS/tWqjBxaU/mCOtaLLmsvNXUHAWoTXmsk6eDhTNUiNzMlY2GoIoTSs vgIYFsyUlQxC0y2VC//y5kMBAev7uSFyN5cpr9g9ojs96RoDXnm0D+0FCFhEXJX8Ivsg A2ENPG5s93cGfpoYgIPx3HDpHwyNl0oGZgIrM5wVjUuXKeHyHsTyco8j+Jas6+FPhuqK G74RRi1TansSE1pphIJy3C0MX2oyqld8I2XmPfYN0xrzON5MiJPD77CV3Gvp/Hv1aOND ipv7Hf1//d4UgJa1DbWp+wfX+bCskQtHqeueib5e4acaFBux+GRZZ72/9LsADW7hHcw5 s/ng== X-Gm-Message-State: AAQBX9chXmHBJi/AiOBQyCGZxIIlUwTaUt75n/X5JNXS2c8rm0fa+KZm +qeR6VkP+k0+d3Iw82FWtNs1OwCpGIAN X-Google-Smtp-Source: AKy350YrukwsAdTNyI0Wf/shTLngC5JsNxShCv0sFeg6K/Q0S0/5mPyD26PL9G5B9RdD/SJchYtYowRZMe00 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a25:7612:0:b0:b8e:ec30:853e with SMTP id r18-20020a257612000000b00b8eec30853emr2112770ybc.4.1681143937400; Mon, 10 Apr 2023 09:25:37 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:06 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-2-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 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_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092539_113299_11D167C1 X-CRM114-Status: GOOD ( 14.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move under tools/perf/ui rather than in perf.c. 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_ */ From patchwork Mon Apr 10 16:25:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206511 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B024CC77B70 for ; Mon, 10 Apr 2023 16:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ImNSl1Scnw3EXU1Kvpqq5SBUf2KhXv82InUbsaX9l8I=; b=gQy0nglbcB+FiN jOXAG5f390ZlDk/smFpZCM7iu6Uqru/30fHd2ywMyQgrL5cwj0ZapZLatuOWHBQK5mpRvlH1jP8XT vUeV27NjmSh160bBsrH8D1Ob5XW3BMP/2SnZ5CTwJuKnaRX9VTIY+ESlnoI+LRlifKerQty+z2UUr SH9P7mQjft5NzYczhR+SON1Vfwk9iOp6hdAKQ3g0mrnhZdYm+j1gaS5h2kwTHEiUN+5Mzt3iMlQ28 kUM3EWzTO5TL0J6bg7I/wHDRN7eIG0tfHXTQktvuj67pyH40CCm2vE10aQl642EKuaA4qVIZs8t/d 1Pr/WUr5xMmObZcLqvoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluL0-00FXRN-2Y; Mon, 10 Apr 2023 16:25:50 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluKx-00FXPE-11 for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:25:49 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 67-20020a250146000000b00b714602d43fso6034619ybb.10 for ; Mon, 10 Apr 2023 09:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143946; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ltJwrJcS5zG2bCT4+GplpXfeO819XnkFUs/Trn7Oeps=; b=JOp/+aX/o5synz6pDxP1umm3bEXkb7P1Ea8j436nJfKATGjPyb6qB2aOkLPNVNcvj8 2maWSZuv2uiKpFb44vh5H7Qa3XdxdXS6evU1KNkO8gHiiN/fE09plTF+YNcDOuI+rke9 EUy9Q09MqBdqt4sduXNh44rI9+/qLZvJvFNsWaoSlV7MMcn1FkfZzB8NZcmYA5CpJVCH 31nfPzq/cONcl4BeaPjxpoNAr+9KUK6doWTQa2HktlaYXIfxXQ72Y4JmmEPBbfJafHFx j5xD9AG7NErwtUBDfVxXQv3oWjThGlizVMKIiAxKKD9AaCAVmicJjq4hNOebUyNKYmtg dbhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143946; 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=ltJwrJcS5zG2bCT4+GplpXfeO819XnkFUs/Trn7Oeps=; b=jOI2W5rIfZhqxUSXigzBc7XqGJGGC3l8s5qWAZVvgnriY3rSNtc3qmG6AQUA4whWgh N1a40Pz4vX6k3hZl5d9/V5qRuHIln9bdMWxz1KzObB3w+ZALREGs5T4FyvYlnTqFQToM Lcf0tUoheVk1Cy+R13dLZDv9/U+pmSOuhs4rUYvQXJFWxKk8h0btxg5elseQLK5LthNG Capl/b5SP7cmEwgcqqVmLJp0qSj7sFiAO8Z3iqh1vYDHfR5fb37kSqgBvDJs5nRf9Saf stAf87fjqaTQuZmXCdi/4hxfk92MoPwUvLWfbxBQ6IaG+5QRh1vtCQfFPxyjy5khePtu CpSQ== X-Gm-Message-State: AAQBX9c5JIA7oSjyPyw/ONhxTCd/n3ehdMt3Bq8QGFe7QxbpXhj2LP0X 905S3OmfJbFPuK2u13az6B8tjiFhB6os X-Google-Smtp-Source: AKy350brhH8r3zG3fNPseFmqcLKPZ39CearAHRvBHkmjMWzSvwbZzj45ONsmp2U3Z0wDblFv+5IYvENPp9aw X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a05:6902:909:b0:a27:3ecc:ffe7 with SMTP id bu9-20020a056902090900b00a273eccffe7mr9982639ybb.3.1681143945997; Mon, 10 Apr 2023 09:25:45 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:07 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-3-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 2/6] perf usage: Move usage strings 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_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092547_360757_15CABC92 X-CRM114-Status: GOOD ( 13.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The usage function is part of util.h, move the usage strings there too. Signed-off-by: Ian Rogers --- tools/perf/builtin-help.c | 1 + tools/perf/builtin.h | 3 --- tools/perf/perf.c | 6 ------ tools/perf/util/usage.c | 6 ++++++ tools/perf/util/util.h | 3 +++ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 3976aebe3677..3e7f52054fac 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -14,6 +14,7 @@ #include #include #include "util/debug.h" +#include "util/util.h" #include #include #include diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h index d03afea86217..f2ab5bae2150 100644 --- a/tools/perf/builtin.h +++ b/tools/perf/builtin.h @@ -2,9 +2,6 @@ #ifndef BUILTIN_H #define BUILTIN_H -extern const char perf_usage_string[]; -extern const char perf_more_info_string[]; - void list_common_cmds_help(void); const char *help_unknown_cmd(const char *cmd); diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 4b1b31e78332..997bb9ea5ebc 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -39,12 +39,6 @@ #include #include -const char perf_usage_string[] = - "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; - -const char perf_more_info_string[] = - "See 'perf help COMMAND' for more information on a specific command."; - static int use_pager = -1; const char *input_name; diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index 196438ee4c9d..4c8ffbad2323 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c @@ -12,6 +12,12 @@ #include #include +const char perf_usage_string[] = + "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; + +const char perf_more_info_string[] = + "See 'perf help COMMAND' for more information on a specific command."; + static __noreturn void usage_builtin(const char *err) { fprintf(stderr, "\n Usage: %s\n", err); diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 1d3b300af5a1..5010abf9e01e 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -15,6 +15,9 @@ #include #endif +extern const char perf_usage_string[]; +extern const char perf_more_info_string[]; + /* General helper functions */ void usage(const char *err) __noreturn; void die(const char *err, ...) __noreturn __printf(1, 2); From patchwork Mon Apr 10 16:25:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206512 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D891C76196 for ; Mon, 10 Apr 2023 16:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LUuyJ/XzB6kTltpSvFOPkQ2DAakuqy92UiFovpXniyo=; b=A07uINyBGCDSsN 79cnZaJPP8DyYXAQkmCFT6AxB313I5FH+9eMYrWmp93sntvGHv3HKafVtagbmbr1PzFKVTejpcQZg FPTARF5OHX1sKliAvhLSgLQ2tr8qxcWsBc0CSGEk7UbHHgxvGEfiTOYcxFpQsmab4WUmUmxGrrSRm pS1c/gfOwFpUq3t/9csuaPY4KUd/siNdd7iqbSbbYgsjN68E9opseYLcR57KG3laParJhbljMXOil vNKOJSRqamXDiQtkZdwXPi9zNOaT0vp1zEGCCfV1UdCkaD5TxQCpb2757sUMpk1avYpwASWjUzeje p61veLbFgxsCOb1yEWEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluLA-00FXUs-1Y; Mon, 10 Apr 2023 16:26:00 +0000 Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluL6-00FXSr-2r for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:25:58 +0000 Received: by mail-pl1-x64a.google.com with SMTP id n3-20020a170903110300b001a50ede5078so5415140plh.8 for ; Mon, 10 Apr 2023 09:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143954; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=aEhyeTvRWmHial5y1xpzuX7Bv+mNf9xTgA+L3gEVz1w=; b=tlQ+zMDl0ubmzI4+JPtuYqjGNoiMwNFDo/CM/Z2CuSmbqjKpEuvu/GPmJQSMRzM2HP 5E/SVf5M4IhVV9fqfBPE2wGDn0xGfocWKu4Rbyde6f4Wc0zrXOpyL/sgoiFbMLA8XRMX xyZzZFgrtcBwojAl4lRqTHBGgWNZJJDfy5x6VJji6M8dC6WkNm2Q9+kS5BDj390vngs0 47I0Us+bwZ6cbdRbqLlg00Akrw8dTHI5xAsYBn3EmQrT8qPE8elIGV3tmnAcboivLaQz 5rTaWvaVprBCOFn4HYOyISGaXcZFjfI/oI/5OUL9DkYx5MADrP4GbolF8Wap5b7P+9El CIrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143954; 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=aEhyeTvRWmHial5y1xpzuX7Bv+mNf9xTgA+L3gEVz1w=; b=XDYNVth96Pm+uL2DBzxWvvsFi8P7qKO8A3OE9S3raYyjd8LwVlgVhWiR2tl8kk71gQ LJov8bwIu59bRmDbM5/gc/LYFOvmsRjpigAPP++uFQ01PwPxJUhsqQjMjeGJ2g0dnPUL g0CsTrsfjE6wCxRZPLhmYFLCvgHbI5St3FfkwKT9coop+/WK5bE7ckwylH0XXJ2prIpF BfQkH6dAuuwhuZKjf4lv+SIs6LHHfIrPPMvxzSeTSWbYBuXy+faQv/TPPYH/tsy5YfMA NZW3kJTw7IIKvVLOhsZ5l93drixfo5m0/abC6vMtMaY3UFO69XypY+cASoR+O0NG4c0F 84Ww== X-Gm-Message-State: AAQBX9cB5G4dH0Ddfnr0Gh+9l+tVT1QgInhjHyWBNVomJagdAG5xb7FY nF17PmR2c4bfkcygbtvR+74DFZcYOC7K X-Google-Smtp-Source: AKy350ZucXc8sW32+DDyUAJfXp9FLneuOPfcdYymaaADUSV5SZWt8ZmhRdsNHbun6QAk8L6tnseXpx+JuE5r X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a17:90a:2ecc:b0:23f:14c9:a606 with SMTP id h12-20020a17090a2ecc00b0023f14c9a606mr2833443pjs.6.1681143954554; Mon, 10 Apr 2023 09:25:54 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:08 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-4-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 3/6] perf header: Move perf_version_string declaration 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_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092556_921296_A27AA079 X-CRM114-Status: GOOD ( 14.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move to match the definition in header.c. Signed-off-by: Ian Rogers --- tools/perf/builtin-version.c | 2 +- tools/perf/perf.h | 1 - tools/perf/util/header.h | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c index c5d03a11e565..4a43043ca8ef 100644 --- a/tools/perf/builtin-version.c +++ b/tools/perf/builtin-version.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "builtin.h" -#include "perf.h" #include "color.h" +#include "util/header.h" #include #include #include diff --git a/tools/perf/perf.h b/tools/perf/perf.h index e21a7e15a34c..20e9b93f8a39 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -10,7 +10,6 @@ extern const char *input_name; extern bool perf_host, perf_guest; -extern const char perf_version_string[]; enum perf_affinity { PERF_AFFINITY_SYS = 0, diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index e3861ae62172..59eeb4a32ac5 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -115,6 +115,8 @@ struct perf_session; struct perf_tool; union perf_event; +extern const char perf_version_string[]; + int perf_session__read_header(struct perf_session *session, int repipe_fd); int perf_session__write_header(struct perf_session *session, struct evlist *evlist, From patchwork Mon Apr 10 16:25:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206513 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79BC5C77B61 for ; Mon, 10 Apr 2023 16:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lLiL37FIu9RV3bxCbCROH2giULXCK/7Q6Aq9ETzve+Y=; b=sYMsKJyz0IbGa4 v/mWQ8yfscPptNXHdakRnrIt6KGojMSN+6eB46PbBEeYzru2rqA4S/A2SUg10AP7mBa8ZcYNJj5If QB0ubXYjL5v7kt2FsdDN356IyFfbC4GLaBGhW8loonwgT/e4SCdKeHvxbnfarqWnnCnok7Cgw8Eqt hdSVTcg6FP5T7dM2aQk814NKLXUQUdTeyXD/NaD9Z9bYrsABWM26FY4rVlbSa2a1tUCngBfYtNAm2 RFeK9diL16Y/Qs4roKRudxGmRQ8+MYs0spDtMSltmz0qAFmVnQknEdfk8AlxNgRF1IlTeWmrHrbWX e0wQHZx2LwdjzbgBkISg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluLG-00FXXr-1q; Mon, 10 Apr 2023 16:26:06 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluLE-00FXWR-1r for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:26:05 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54f1ffb8ccfso30330877b3.9 for ; Mon, 10 Apr 2023 09:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143963; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=FAKcvnru9LhkR//8Z23t2DNVEpqXFn8ayozPZi4Bsbc=; b=ZlxrVPlBY21wSaZW+DAvl8tIqVC9Zo6H8PbzHQaBLlqimhq2OYMcRSxpTkFMKjIntJ NLpyQg2qoR08VuuU6TLKhNfr0Vi8XuDSw9b6WcUihXYPlnOADt3M90QDgI1OBzkkNTce gJFase72Q/ZB4K2s42u6O/xU1Ey0stnH/eFqKzZ5xhkED/d8wQZ2SxHBrf+hNevH4oKr HAfU6UB4BVpW57ZSQ21BLke3U0ohRzoPIHtGzuBepgXeeXktWGKaDaRdB0cE4eQer/Ot 8/cJX1AzT50llbES/wXAMnv5WoWJiTbGD05fucJnPO8AzYCOCgfIWU3DIfml7FS9hmZB QSGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143963; 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=FAKcvnru9LhkR//8Z23t2DNVEpqXFn8ayozPZi4Bsbc=; b=b2Fxq4KTs83HLo6+2VBdexnBliIkAwo0f94R+nVR1quetCa/1ngnhUvQoI2025r9Es PTu2GPxFyLS0TAN5cJ2/FpOSih17hoUfBD6G1H32V7EyVY0QjgR5ATaLK9X5WUrx7Nmx QVdeFDeWTBEgrf5ehDvVKjj65V5mdR8kn1r0AWF5pGMUSRRhD/pIASGWu198Ey/ZmgoO KAVqOX62tqUAKYTdNB94DhU+fZdZJmTxVzRtK+EJo/6C3U2HQfgp/V0Atz9w+Ewg6KmH U3KpadIyXPDcvqmnwhrsNVibhZEcwrnbGEnS8oaJssp/LH15lYBuJVcyb6BllkSs7++T 46Mg== X-Gm-Message-State: AAQBX9cHrtC6e7M8EkPG1IOE9MSSLnWy5mLiSA2Vq0jLBId7kqm2ieY9 yKaZxEtsutcX+jt8lSmRBid9V+7mFdEZ X-Google-Smtp-Source: AKy350YhUo6COduyV7IGvsxdXTy/uJRIZ7HQAkSp4QlAlHDO8Gcg9suPG52L1YdLMyG6tq5CZEdWZsPB2R8e X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a25:da56:0:b0:b4a:3896:bc17 with SMTP id n83-20020a25da56000000b00b4a3896bc17mr5458791ybf.0.1681143962891; Mon, 10 Apr 2023 09:26:02 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:09 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-5-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 4/6] perf version: Use regular verbose flag 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_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092604_615997_C9C77CB9 X-CRM114-Status: GOOD ( 15.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove additional version_verbose flag by using the existing verbose variable. Signed-off-by: Ian Rogers --- tools/perf/builtin-version.c | 5 ++--- tools/perf/perf.c | 2 +- tools/perf/perf.h | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c index 4a43043ca8ef..1872c90a6667 100644 --- a/tools/perf/builtin-version.c +++ b/tools/perf/builtin-version.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "builtin.h" #include "color.h" +#include "util/debug.h" #include "util/header.h" #include #include @@ -8,8 +9,6 @@ #include #include -int version_verbose; - struct version { bool build_options; }; @@ -92,7 +91,7 @@ int cmd_version(int argc, const char **argv) printf("perf version %s\n", perf_version_string); - if (version.build_options || version_verbose == 1) + if (version.build_options || verbose > 0) library_status(); return 0; diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 997bb9ea5ebc..441c354b8304 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -212,7 +212,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) if (!strcmp(cmd, "-vv")) { (*argv)[0] = "version"; - version_verbose = 1; + verbose = 1; break; } diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 20e9b93f8a39..989eb17ec474 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -18,5 +18,4 @@ enum perf_affinity { PERF_AFFINITY_MAX }; -extern int version_verbose; #endif From patchwork Mon Apr 10 16:25:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206514 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FAF1C76196 for ; Mon, 10 Apr 2023 16:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4yTmeLN1X9pEUlKtKCoQi1qE3iVu94fRj9ToSVdoWrg=; b=k3ws/UZCV3jHfy ZSA4rC6B/ZByieRWAMJfCUY2cRurt2OKrtKe3m3Vm+I8b2rELakE5SwmttMee3G1lN2LY6sN/Yt/0 GgATV+x6oEjR4oOiC2YZTLkZrJyPlbC4xjzAv6TMfWzx1GV6uKdlLAsIHcq3frPpDaCh5LoSwXc6/ YUYONWWDxzZ6Dt7C6p3IOzg0y9bx6KPkCe9ZuvUJl6nXjkvFHu0sInWqxX15Djgl68NZdwgugkZTV PHU/fPK7q8+0rd4Zjslo6+0fvr8N4Ank60wOPz9Q6mpEsPxKslcDoc/loKpxHo4tKBNRfW8jkK8+r 3AM9txMFfVlo7/TkGUBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluLO-00FXcI-2C; Mon, 10 Apr 2023 16:26:14 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluLM-00FXWR-0i for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:26:13 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54f1ffb8ccfso30334477b3.9 for ; Mon, 10 Apr 2023 09:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143971; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=Xp8qLxoPhgd5S79+sqfPyJ+NqpGI+WyWEYYgtfPYRjQ=; b=ZDRXwNY5e5FPtxB9zhgqLDyi3UwHdvrnISVCBcv0Bgsxi+Y+9o3obk/zEQGnouLpQk lyg90YffGBG8iuUJA+NxRopBoHNEPQcLCx6IlQ6+oxDBxTNmXdYmQHs74Y36H3BGGRwQ CGioOAduSeN83A/+TgLA/qDYxAWrXT79qsiZIUpHMFtCydZBQnjQClXUigmkOVblubwD 0/ipnMAxCOjXmYoGTCvqjGL9ojwjbbpjYxCWxW/9NilX4fFavuYQIUhzg5tO/9E3SGuw HhzkmZVTGgOEEH3nxxcvN11La1WnERbwiw/wG1813xqPRhdXAF+LurSOOcdY5INZ20Je jD2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143971; 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=Xp8qLxoPhgd5S79+sqfPyJ+NqpGI+WyWEYYgtfPYRjQ=; b=HL7IprKP/Dlujc6oUmkelylCl/tv7/ed/IQo6bDvf8oVeSffUsX5Yj65oUgw8TrKid AojX4X2B3GpcgZcrrIlGFT0/tTorvsntw6/90yvfVYJGbGzWnxX0K3FEvyqg27aw2R7v RahxR3t3TsJx0OLMtqpN4tFQAG656IoiM5QSY1yrMxbDnBgr7g+5fKBQ2zGSGVtsFIp3 HPGe8AATZFiyDvA7B4oHBL5uUbqAsYIdnaXSKqqYSeqHfXsFJqubn71bCZnSzExiKj1s e8QQlRkjQAhZSZmTmIUBBskc7qbKju02C57Z/cMu4fs99AVAmuxehOZs4Q8uAfO1/4/X 4CLw== X-Gm-Message-State: AAQBX9czUT8HvB/tfrNUeftqyLp1KDwB4+1fGqXJdJ1tJhAtTFdjYBj1 +VZ5iCzw45Y5X940aURbrkvKBqQ9XMAr X-Google-Smtp-Source: AKy350aouxxZ7jU7zNe3eUUa4vRGvDHz2LG7vg0V6RtkPpSG3EqLqVAQ4jykf6wV2keZV3jykI2OBNNYZD2S X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a81:e401:0:b0:54c:19a6:480 with SMTP id r1-20020a81e401000000b0054c19a60480mr5951915ywl.4.1681143971215; Mon, 10 Apr 2023 09:26:11 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:10 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-6-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 5/6] perf util: Move input_name to util 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_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092612_260432_C6D831BB X-CRM114-Status: GOOD ( 16.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org input_name is the name of the input perf.data file, it is used by data convert and ui code. Move it to util to make it more consistent with other global state. Signed-off-by: Ian Rogers --- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-buildid-list.c | 2 +- tools/perf/builtin-c2c.c | 2 +- tools/perf/builtin-data.c | 2 +- tools/perf/builtin-evlist.c | 2 +- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-kwork.c | 2 +- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-timechart.c | 2 +- tools/perf/perf.c | 1 - tools/perf/perf.h | 1 - tools/perf/ui/browsers/hists.c | 2 +- tools/perf/util/util.c | 2 ++ tools/perf/util/util.h | 2 ++ 16 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 63fd2080b803..63cdf6ea6f6d 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -15,7 +15,6 @@ #include #include "util/symbol.h" -#include "perf.h" #include "util/debug.h" #include "util/evlist.h" @@ -36,6 +35,7 @@ #include "util/block-range.h" #include "util/map_symbol.h" #include "util/branch.h" +#include "util/util.h" #include #include diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index eea28cbcc0b7..c9037477865a 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c @@ -8,7 +8,6 @@ * Copyright (C) 2009, Arnaldo Carvalho de Melo */ #include "builtin.h" -#include "perf.h" #include "util/build-id.h" #include "util/debug.h" #include "util/dso.h" @@ -18,6 +17,7 @@ #include "util/session.h" #include "util/symbol.h" #include "util/data.h" +#include "util/util.h" #include #include #include diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index d3181fee4d3d..6c12f0865860 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -41,10 +41,10 @@ #include "symbol.h" #include "ui/ui.h" #include "ui/progress.h" -#include "../perf.h" #include "pmu.h" #include "pmu-hybrid.h" #include "string2.h" +#include "util/util.h" struct c2c_hists { struct hists hists; diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c index b2a9a3b7f68d..ce51cbf6dc97 100644 --- a/tools/perf/builtin-data.c +++ b/tools/perf/builtin-data.c @@ -3,10 +3,10 @@ #include #include #include "builtin.h" -#include "perf.h" #include "debug.h" #include #include "data-convert.h" +#include "util/util.h" typedef int (*data_cmd_fn_t)(int argc, const char **argv); diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index b1076177c37f..7117656939e7 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c @@ -7,7 +7,6 @@ #include -#include "perf.h" #include "util/evlist.h" #include "util/evsel.h" #include "util/evsel_fprintf.h" @@ -18,6 +17,7 @@ #include "util/debug.h" #include #include "util/tool.h" +#include "util/util.h" static int process_header_feature(struct perf_session *session __maybe_unused, union perf_event *event __maybe_unused) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index fcd2ef3bd3f5..2150eeced892 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 #include "builtin.h" -#include "perf.h" #include "util/dso.h" #include "util/evlist.h" @@ -24,6 +23,7 @@ #include "util/debug.h" #include "util/string2.h" +#include "util/util.h" #include #include diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index dc59d75180d1..a9395c52b23b 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -6,7 +6,6 @@ */ #include "builtin.h" -#include "perf.h" #include "util/data.h" #include "util/evlist.h" @@ -20,6 +19,7 @@ #include "util/string2.h" #include "util/callchain.h" #include "util/evsel_fprintf.h" +#include "util/util.h" #include #include diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 1e27188b0de1..65465930ef8e 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -4,7 +4,6 @@ #include #include #include "builtin.h" -#include "perf.h" #include #include "util/auxtrace.h" @@ -22,6 +21,7 @@ #include "util/pmu-hybrid.h" #include "util/sample.h" #include "util/string2.h" +#include "util/util.h" #include #define MEM_OPERATION_LOAD 0x1 diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 86e18575c9be..96a0dceadeff 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 #include "builtin.h" -#include "perf.h" #include "perf-sys.h" #include "util/cpumap.h" @@ -27,6 +26,7 @@ #include "util/debug.h" #include "util/event.h" +#include "util/util.h" #include #include diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 38133afda7fc..341b660f5b8c 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -41,7 +41,6 @@ */ #include "builtin.h" -#include "perf.h" #include "util/cgroup.h" #include #include "util/parse-events.h" @@ -71,6 +70,7 @@ #include "util/bpf_counter.h" #include "util/iostat.h" #include "util/pmu-hybrid.h" +#include "util/util.h" #include "asm/bug.h" #include diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 6c629e7d370a..bce1cf896f9c 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c @@ -24,7 +24,6 @@ #include "util/thread.h" #include "util/callchain.h" -#include "perf.h" #include "util/header.h" #include #include @@ -37,6 +36,7 @@ #include "util/debug.h" #include "util/string2.h" #include "util/tracepoint.h" +#include "util/util.h" #include #include diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 441c354b8304..38cae4721583 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -40,7 +40,6 @@ #include static int use_pager = -1; -const char *input_name; struct cmd_struct { const char *cmd; diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 989eb17ec474..49e15e2be49e 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -8,7 +8,6 @@ #define MAX_NR_CPUS 2048 #endif -extern const char *input_name; extern bool perf_host, perf_guest; enum perf_affinity { diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 9f9f622325ae..ab70e5f5fad2 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -29,8 +29,8 @@ #include "../../util/top.h" #include "../../util/thread.h" #include "../../util/block-info.h" +#include "../../util/util.h" #include "../../arch/common.h" -#include "../../perf.h" #include "../browsers/hists.h" #include "../helpline.h" diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 089208b51e68..c1fd9ba6d697 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -28,6 +28,8 @@ * XXX We need to find a better place for these things... */ +const char *input_name; + bool perf_singlethreaded = true; void perf_set_singlethreaded(void) diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 5010abf9e01e..8bd515b67739 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -18,6 +18,8 @@ extern const char perf_usage_string[]; extern const char perf_more_info_string[]; +extern const char *input_name; + /* General helper functions */ void usage(const char *err) __noreturn; void die(const char *err, ...) __noreturn __printf(1, 2); From patchwork Mon Apr 10 16:25:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206515 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB531C76196 for ; Mon, 10 Apr 2023 16:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=py6jhY402xME1mLIDyd5KmnegmIP8eqU4Qh+jM4Ny2Q=; b=uk4gMIDDFVymnC MvZIq0MQ6PG0xlc2gsVCDMVZtv0Uro/8BJE+2r1fMQp0/SSV8tLqb7hUPZzW6XXci01jIbXI73SYY pEdeQXyJxoSpCHx0RCEGMlJUGngRxE4dhBv/fm3AC9igqH0WMkROWGq+trf2lyfkXKOdZ+SWfSJqU Jn2Se4/+NAzAnjfG74v50iQNzSD2HQtoWTM573qNpPxa27ZIIXo3zXhKQ1IwertW9e6ExkyDaUoM9 3K2DbQhJwWjdW4+54MqSqVkXtJjWqrPngHxZFyXtjMZxAyq0epxoaZPeBvFCc9te92Nz+MppDvu6j GVUoMyKaRD1fRdQ/p7vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluLZ-00FXi4-0R; Mon, 10 Apr 2023 16:26:25 +0000 Received: from mail-pg1-x54a.google.com ([2607:f8b0:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluLV-00FXer-23 for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:26:23 +0000 Received: by mail-pg1-x54a.google.com with SMTP id i63-20020a638742000000b0050bdffd4995so2227508pge.16 for ; Mon, 10 Apr 2023 09:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143979; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ENoaaMVMubn/KcAmMx1x6HeWtqhy9i1fT7aioBHDXcc=; b=fkdy28z/x/2Y6DzjeJO8cFcorqVS2iQDlBg6nwCCEsLmc0YSKFWRkDDUBgK4Qh1ssz iwDNO8Hd67Ef16nRflOkFUiIt5a51EaDJfN8UTwPD/whOCTFh3F84c8IR+pfECYUKq7g r13FbXs8yGWePJRNzWzgWMNv8kD4JnSxRR/XCbXBwGw2C3tBkdCU1AtzfP0MjS9tH/Hj DoiqwLgdulk6HRVolSVLCb/W+HEc28AwroX6CCqmdX984fjU6q0/20gcNlvwMzy2kJbA AQ5UfAuoCMSmIFeZaNhmzckv86+tjNerhMdEve/6c13D+HEOOq85zJhaNLfcdRtH0s2x bQ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143979; 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=ENoaaMVMubn/KcAmMx1x6HeWtqhy9i1fT7aioBHDXcc=; b=GQJUS7dwCVwPD6kEajIonUxqrOst5X5DHFn26fm5OZgK1glPTB5cLCM9TjK+HL/6v3 swTBT/1jA0yCjxw33JfSVzX49YCzRsQxnCGLTiqX6m2+58uHxv9JhepajZVQRweJvokv NXioKV4t6uw5qWCeAXBvHS0CNdYh3P1HhM7/fz/pa2o9kF0L4ChkecqDt3q/et/kFtvK U/0Uss0KnyomveEgL/D3Z01S9P6+fn3ICZyr376yTvWRlj/1MsYoO9bwIeUtDdx5JYDD pHNLih9t18g1jATqHAACacF4AHF7h2nDGuHF7DZ1GKDYuFTDgl5i9CPN6aNgJ4TSlgEg P9aw== X-Gm-Message-State: AAQBX9exLHbUiRHHJOGK8v33AwHLxSaVQ+AIcJebtrP7Q8xWbb6cRU2z AVYhQo33VsX6mtYdTjFi7AFIaggvY3EO X-Google-Smtp-Source: AKy350bzXEkhKfRJnIJa5gh4FNDi8DMbaX5c5UaYQ5moE3r6h9mw8wVurekcapCgL+GPU6sq4aikyT8kE+VD X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a63:4466:0:b0:509:4ac5:7f3a with SMTP id t38-20020a634466000000b005094ac57f3amr2582205pgk.0.1681143979133; Mon, 10 Apr 2023 09:26:19 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:11 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-7-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 6/6] perf util: Move perf_guest/host declarations 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_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092621_674198_A93854C8 X-CRM114-Status: GOOD ( 15.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The definitions are in util.c so move the declarations to match. Signed-off-by: Ian Rogers --- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-kvm.c | 1 + tools/perf/perf.h | 4 ---- tools/perf/ui/hist.c | 2 +- tools/perf/util/cs-etm.c | 1 + tools/perf/util/event.c | 2 +- tools/perf/util/evlist.c | 1 + tools/perf/util/parse-events.c | 2 +- tools/perf/util/session.c | 2 +- tools/perf/util/top.c | 2 +- tools/perf/util/util.h | 3 +++ 11 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 22b526766e14..dbb0562d6a4f 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -6,7 +6,6 @@ * DSOs and symbol information, sort them and produce a diff. */ #include "builtin.h" -#include "perf.h" #include "util/debug.h" #include "util/event.h" @@ -26,6 +25,7 @@ #include "util/spark.h" #include "util/block-info.h" #include "util/stream.h" +#include "util/util.h" #include #include #include diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index fb9dc0dc46f9..747d19336340 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -23,6 +23,7 @@ #include "util/data.h" #include "util/ordered-events.h" #include "util/kvm-stat.h" +#include "util/util.h" #include "ui/browsers/hists.h" #include "ui/progress.h" #include "ui/ui.h" diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 49e15e2be49e..c004dd4e65a3 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -2,14 +2,10 @@ #ifndef _PERF_PERF_H #define _PERF_PERF_H -#include - #ifndef MAX_NR_CPUS #define MAX_NR_CPUS 2048 #endif -extern bool perf_host, perf_guest; - enum perf_affinity { PERF_AFFINITY_SYS = 0, PERF_AFFINITY_NODE, diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 5075ecead5f3..f164bd26fc41 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -11,7 +11,7 @@ #include "../util/sort.h" #include "../util/evsel.h" #include "../util/evlist.h" -#include "../perf.h" +#include "../util/util.h" /* hist period print (hpp) functions */ diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 944835e16430..103865968700 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -38,6 +38,7 @@ #include "tsc.h" #include #include "util/synthetic-events.h" +#include "util/util.h" struct cs_etm_auxtrace { struct auxtrace auxtrace; diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 13f7f85e92e1..8ae742e32e3c 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -33,7 +33,7 @@ #include "bpf-event.h" #include "print_binary.h" #include "tool.h" -#include "../perf.h" +#include "util.h" static const char *perf_event__names[] = { [0] = "TOTAL", diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index cc491a037836..df6af38ca22e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -32,6 +32,7 @@ #include "util/pmu.h" #include "util/sample.h" #include "util/bpf-filter.h" +#include "util/util.h" #include #include #include diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 0010e5e0ee68..f341995cb04e 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -25,10 +25,10 @@ #include "util/parse-branch-options.h" #include "util/evsel_config.h" #include "util/event.h" -#include "perf.h" #include "util/parse-events-hybrid.h" #include "util/pmu-hybrid.h" #include "util/bpf-filter.h" +#include "util/util.h" #include "tracepoint.h" #include "thread_map.h" diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 7d8d057d1772..e2806791c76a 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -33,7 +33,7 @@ #include "stat.h" #include "tsc.h" #include "ui/progress.h" -#include "../perf.h" +#include "util.h" #include "arch/common.h" #include "units.h" #include diff --git a/tools/perf/util/top.c b/tools/perf/util/top.c index b8b32431d2f7..be7157de0451 100644 --- a/tools/perf/util/top.c +++ b/tools/perf/util/top.c @@ -11,7 +11,7 @@ #include "parse-events.h" #include "symbol.h" #include "top.h" -#include "../perf.h" +#include "util.h" #include #define SNPRINTF(buf, size, fmt, args...) \ diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 8bd515b67739..7c8915d92dca 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -20,6 +20,9 @@ extern const char perf_more_info_string[]; extern const char *input_name; +extern bool perf_host; +extern bool perf_guest; + /* General helper functions */ void usage(const char *err) __noreturn; void die(const char *err, ...) __noreturn __printf(1, 2);