From nobody Wed Feb 11 16:48:36 2026 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 63172C77B70 for ; Mon, 10 Apr 2023 16:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbjDJQZr (ORCPT ); Mon, 10 Apr 2023 12:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbjDJQZp (ORCPT ); Mon, 10 Apr 2023 12:25:45 -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 229F819A8 for ; Mon, 10 Apr 2023 09:25:38 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54c17fb245dso112596767b3.21 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=SUJ9G3wmuPCMAhvNPJref26gxeDlH863HBaiZBsFwuUEoOGuSFPOSAJcNEVE6OB1ky pM1rcOcPnfcvwkHFVeaLYK7XBLdByLb2tmgVoqEoobWXMeWu07JcnnesltGk93B6NPy1 Q/n78fTxiGaEkr9PoDVYkyGQ7A22uc8t9SqzyP6i3eTut8DFDP7oyfL9fSiU0/yZWuCx FZihA4H1vl8dD9s/mi9n8H8F8L/QJ+T5rpbP66lMm2RGJl2ohdj7DSsR7F+bnC59jNhX mVStc6pY0P0DlGeGWc/nB2WPvLQPv6glAgo/R7EnO5lPWzPn2cLGdoOotY1fBO78wVXW 4p+w== X-Gm-Message-State: AAQBX9dxYEdrruV9QGFH8PTgDgo7OcB7s0SnRoaMgVm/c9izVu0lSGDd 5zCdDzIh/6qi+d1f0DQr7sZoFiSUjagt 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=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; } =20 -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[]; =20 -void pthread__unblock_sigwinch(void); - enum perf_affinity { PERF_AFFINITY_SYS =3D 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 =20 #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 =20 #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; =20 int stdio__config_color(const struct option *opt, const char *mode, int un= set); =20 +void pthread__block_sigwinch(void); +void pthread__unblock_sigwinch(void); + #endif /* _PERF_UI_H_ */ --=20 2.40.0.577.gac1e443424-goog From nobody Wed Feb 11 16:48:36 2026 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 2A41EC77B61 for ; Mon, 10 Apr 2023 16:26:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230202AbjDJQ0H (ORCPT ); Mon, 10 Apr 2023 12:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbjDJQ0B (ORCPT ); Mon, 10 Apr 2023 12:26:01 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25EA1727 for ; Mon, 10 Apr 2023 09:25:46 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-54efad677cbso49167277b3.6 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=Yh7wXMZkW+I4SbQrpLKxISuTBPci+BozHbz0NeJJxPtBzBMd+K2OHJm5UbUpO2niyT eYrWTu4B3gmuWpqDMif7UGFbfEtd/cz+jpQRoi6K9iMT/XIYpCWDKWNtEKzowVfaASbC +Opswi7WVdHae7AHZNmDPujG7IEc82dmGE1L9pXFENfGMJU6uyYRS/7bAHLHv1yZvdry TswRz6GXIjEdbDUhxpzQ+rc1epSCOUPEpbm5PmBpu2XJkq7zTDaDkKoRRAXgAuUKaGZu iQWeXdicCrMpQLuRyiMMoqrLjo8MsmathvKJxP+IiGWc16bHXh9YTZTgosKEFDT9nwoh ydBQ== X-Gm-Message-State: AAQBX9dCxaTSRDP+LHmSfeHZVY5wg254a4ckvHwvV8xxtPulQ2kZXRLJ qYP5HBWQ3hKTQm51557jBVrf9dHf1QVT 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=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =20 -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); =20 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 =20 -const char perf_usage_string[] =3D - "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; - -const char perf_more_info_string[] =3D - "See 'perf help COMMAND' for more information on a specific command."; - static int use_pager =3D -1; const char *input_name; =20 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 =20 +const char perf_usage_string[] =3D + "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; + +const char perf_more_info_string[] =3D + "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 =20 +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); --=20 2.40.0.577.gac1e443424-goog From nobody Wed Feb 11 16:48:36 2026 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 497A1C77B61 for ; Mon, 10 Apr 2023 16:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbjDJQ0X (ORCPT ); Mon, 10 Apr 2023 12:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbjDJQ0M (ORCPT ); Mon, 10 Apr 2023 12:26:12 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DC0E2708 for ; Mon, 10 Apr 2023 09:25:55 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id o10-20020a17090a55ca00b002400db03706so1454786pjm.0 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=E9ivrigkrI/0DOqKVR1iZu0CqjF3gDHe/UrTFMhBvMBuhueFRy5QmAr0asmiijcOd9 O4wXAq7BevzYp0jqm41Ofa5IKGYhQHDOjuYcQ+1rNUrIO/SxvYkK55hYtMlNpMcvhZIy JNrX03kf/ObUQgsHp2uvK9UhEc6HG91L2Fm0Dl7PrVI+gP+mY/8668oYJWwIwUr29pKR 7HqiLJ/4DUQ6TKO+lXX/zbRnYKGh0qSnCL9u8IiJMZiB672hIXQgcIndyEhNqlqENR8Q 2Djk24FIlUcZAMoUyCf07fapagIgKpQFyXPXudhV5U8TS5PNjkq0+VxW7PTzlocOhFvl p/CA== X-Gm-Message-State: AAQBX9exI8a9XKTj4LIFDYs6fHJnySf+H4fj+NjYvPijxAeDpucsjaAN 6LlBNiwVUdNiR5iXlaDKUv2QTaIP1cZ0 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=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 @@ =20 extern const char *input_name; extern bool perf_host, perf_guest; -extern const char perf_version_string[]; =20 enum perf_affinity { PERF_AFFINITY_SYS =3D 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; =20 +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, --=20 2.40.0.577.gac1e443424-goog From nobody Wed Feb 11 16:48:36 2026 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 D2676C77B70 for ; Mon, 10 Apr 2023 16:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbjDJQ0e (ORCPT ); Mon, 10 Apr 2023 12:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbjDJQ0Y (ORCPT ); Mon, 10 Apr 2023 12:26:24 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FE311988 for ; Mon, 10 Apr 2023 09:26:03 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b124-20020a253482000000b00b8f1b9d74ecso11210yba.18 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=JJxbXkO5RLhLftUMk9mY0HR+acGi6Lo2F4PLK15svtcFgX5ZGforYHVKCiPHvn+wHL e7Mr3fF90VewJ+pM2i4ruBgLfpjbjIElAw+KQ50EVihchRnzjC3xODB/y29Aq2TdDgjK H0qMx84xdCXBMHZVSlfEO2ON6+Bu6sPBYoSS/j3Na5U8LrfPORrTw9KrwoTvidEz6QwX dTxXwuIGaYwLSUFB5x5J5gqMz8nZ7smZOlVH6FOCHIhiWvHWVsyZta7riLT8RXmFFdbv 4HbzvY1p0xIRR/K3biwY+UbHGQoI23VBs05iAY5YmrwvOYrLTPV27jiMmVDGho8VMNv3 gZlQ== X-Gm-Message-State: AAQBX9cRNnOZUXOMBTnDOB+oDZW7B/MJ1LIXwQPNkb5SBYEnVohP4EB6 gxReR4qKWaFJJbH+LPbuxLSQuzwwD1xV 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=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =20 -int version_verbose; - struct version { bool build_options; }; @@ -92,7 +91,7 @@ int cmd_version(int argc, const char **argv) =20 printf("perf version %s\n", perf_version_string); =20 - if (version.build_options || version_verbose =3D=3D 1) + if (version.build_options || verbose > 0) library_status(); =20 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) =20 if (!strcmp(cmd, "-vv")) { (*argv)[0] =3D "version"; - version_verbose =3D 1; + verbose =3D 1; break; } =20 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 }; =20 -extern int version_verbose; #endif --=20 2.40.0.577.gac1e443424-goog From nobody Wed Feb 11 16:48:36 2026 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 487F1C76196 for ; Mon, 10 Apr 2023 16:26:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230289AbjDJQ0i (ORCPT ); Mon, 10 Apr 2023 12:26:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230262AbjDJQ0a (ORCPT ); Mon, 10 Apr 2023 12:26:30 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 008FB1BD3 for ; Mon, 10 Apr 2023 09:26:11 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-54c08e501d2so128909657b3.11 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=g8Dk7/8ldxfP1JGBgLMoser4oSzwvLD4CXnfGuHvIhcX3ZetD4Hubdman6WpVtO0u2 nyXtTuwYEGcAGvjenIWDYW1xe5wH38RuU+K+aLmoVEoojLqRPci3u1uGzlWQVi/P5MyZ prytLk3jfmdiafqD3F0qE/d+wqNRR2ghrA8E2qJSzOfeijOYnSSzq2N/5hUGNE+KAwrG 6/aBb5IUyND4Z9PJAg/0uYqSdOIZCYiIq5gv0QVWUa9DAqJLhVWkN72JeG7F0eczwQuJ UR+H353N3Oh+lMuWr6wWVJ/qTNgl5Jd1Cl8xirG/dI0yQF9aLJknTDqCZe30VLn3dFO3 82qg== X-Gm-Message-State: AAQBX9cvEHvli+hWWxKhevb1bBX4CmKxtUJfSARshFGKAQOwImuPu7bG e3QO0hbI4kR7D3S4RO1GGWbNZvhj4G/L 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=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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" =20 -#include "perf.h" #include "util/debug.h" =20 #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" =20 #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" =20 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" =20 typedef int (*data_cmd_fn_t)(int argc, const char **argv); =20 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 @@ =20 #include =20 -#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" =20 static int process_header_feature(struct perf_session *session __maybe_unu= sed, 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" =20 #include "util/dso.h" #include "util/evlist.h" @@ -24,6 +23,7 @@ =20 #include "util/debug.h" #include "util/string2.h" +#include "util/util.h" =20 #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 @@ */ =20 #include "builtin.h" -#include "perf.h" =20 #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" =20 #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" =20 #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 =20 #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" =20 #include "util/cpumap.h" @@ -27,6 +26,7 @@ =20 #include "util/debug.h" #include "util/event.h" +#include "util/util.h" =20 #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 @@ */ =20 #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" =20 #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" =20 -#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 =20 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 =20 static int use_pager =3D -1; -const char *input_name; =20 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 =20 -extern const char *input_name; extern bool perf_host, perf_guest; =20 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" =20 #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... */ =20 +const char *input_name; + bool perf_singlethreaded =3D true; =20 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[]; =20 +extern const char *input_name; + /* General helper functions */ void usage(const char *err) __noreturn; void die(const char *err, ...) __noreturn __printf(1, 2); --=20 2.40.0.577.gac1e443424-goog From nobody Wed Feb 11 16:48:36 2026 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 AB1B2C77B61 for ; Mon, 10 Apr 2023 16:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbjDJQ05 (ORCPT ); Mon, 10 Apr 2023 12:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbjDJQ0d (ORCPT ); Mon, 10 Apr 2023 12:26:33 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2B201BFE for ; Mon, 10 Apr 2023 09:26:19 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id l69-20020a638848000000b00519e800366eso1164671pgd.19 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=YCzZR0y0HCxQ4mv2f/+ibmexvmazGX2oWYpNYDy0aRFBcM+xzH2LV5Yj68ufZ99uQe 88yFHnzga/ul+StKI7Gbd5wnXgmIjAsVX/oG/PGjsDUWbsX7ls03E/IZsYN2+KLgMg4z IyWwiEPw+0zUh5IP9wyTNSboI6z8NrdjezVBwdB+DTt79w3D/7Y2DirDSbFSypnQG3Wf 0fu7ENsoZfZQa+v8m6Pe/EhoeGuUA09PUnLnxsqlE4sRRW1/+68E/gZ/FZkyj+XCq7iR 8X7/z9TSNhAmuvJFGTT3nrmACPEZ68HKcg54ZgWAlU63770wlRy30S7FjvZngZ1VXnHO yGQA== X-Gm-Message-State: AAQBX9fRirr8D5gzSeCg67+C7uwSc1bDR+V5ijLFSf5rd5GxrSif3PDw 31VuCg+wLY0RQJg8rBIpx94UJhoK3QcE 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=20Li=C5=A1ka?=" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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" =20 #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 =20 -#include - #ifndef MAX_NR_CPUS #define MAX_NR_CPUS 2048 #endif =20 -extern bool perf_host, perf_guest; - enum perf_affinity { PERF_AFFINITY_SYS =3D 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" =20 /* hist period print (hpp) functions */ =20 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" =20 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" =20 static const char *perf_event__names[] =3D { [0] =3D "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" =20 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 =20 #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[]; =20 extern const char *input_name; =20 +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); --=20 2.40.0.577.gac1e443424-goog