From nobody Sat Sep 26 10:01:32 2026 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E03C24A92DB for ; Wed, 2 Sep 2026 15:49:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364147; cv=none; b=tb9P+cauKppWWrn24QrCSYLfzv2Cq3h4xVJXQBzckSOozsLHmbTLh1gEgGkznhZl+5nf4nG5w8DlaXPee1bMoDOg5hUUI1NfVlDxF3XoigLQ9YKltO3lqCsrtGrHICXuc/CNKpXPd149eKLQ2hcwvbcE3FmONM2ta40gGk1Tv+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364147; c=relaxed/simple; bh=Hc042OnjMbeOhiRDfxFyqOhhVR8bwn2dxdpXlOvXKd8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=esUfO45wIKDEJWIOPLfEi+pFYPGIJF3Bd1vRzwPjMdy7765AC3mBpMjkgCrJcDq00K94WzMISTANZfREZBiKMHNypxDRsfdr1b5KcjoVJuEdKnzCi8aBaaEX6jb2J1dLM+1GSknP534tbNajMKuMPkPqOPzeND9I5Z+dzoN2p7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jc08JaDr; arc=none smtp.client-ip=209.85.216.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jc08JaDr" Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-399311947f6so2303457a91.0 for ; Wed, 02 Sep 2026 08:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788364144; x=1788968944; darn=vger.kernel.org; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8aBBetvGBVEfqoHqsirSJaUaP1jK8F5YiaqOaygKhtc=; b=jc08JaDrr7tgr9N2RHTbQVQBt6BHGYLjZsXuj5Wq6ADVAm6f7fgRa5IJmvnSq60CFh /jq8wiQqnZfgk282eBhWy/D9+ChPOYsQDMDC0dO3WKI7BWyDDRsKV2KoGr4WY76OFLPk odIngrLIoaWMdzLtkMnvobkdTZpSkj5gnD8UjwP2dhxlvFDYOgN32/11fIK7ZC7QGLBw 8ane0lumOQ/vI4900w0s8RO/uri38XNxfyKg3BOxV7FQucMxBIfQLBA2uZpeIOyT3EkK UmVeUJ4uJQipYTVxYb6RpHUtE+XOJ/KXzdz3DKxh0QE3VihSyFbPz7fAsbbUz+gzdId0 l3HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788364144; x=1788968944; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8aBBetvGBVEfqoHqsirSJaUaP1jK8F5YiaqOaygKhtc=; b=CYuNQ7SE1g5XM9fA4Xr1ktjfkU1v+Hqk/GXSCl8jdvZ9NW65lj4d97jwvVSEqN6FK/ COY1qi2tmjFiWwHoP3pXHNP8ENDaTiLVw/fpzfrt75WjwWNn0/aPtMmWkG4gVqalyrdp R04Ov3jlgNL4wNUndpgmBHQRHlRDllh3VW34mKAp1+SWu1gtNBz12pmOGsvWrQkAydRp ToOZ/hcHw1HiJd5sNNiQSIViQbR8W6He854ts3AUDYOpS0zDTHWCwCV8IERxEglb8n6t W3Usi1IpWKbjmvp0/IctweqsqUE5NKC4tuR52yz2sY3uMOX7KAiy7cpOIzMbJ6eATFen L0pQ== X-Forwarded-Encrypted: i=1; AKwUvBzq7y1AGn8F5AptWLOCH63lAPMGIU7Jjm/LA6JvyWZMSs/GPFqijSyCMdxj1CMUjPSSdqJKDNbTdPuY8qc=@vger.kernel.org X-Gm-Message-State: AFuF++mGU2fK4ddtyiAd2LiPBL529lJ49Wa5JYpmcySDXliWTbXHg5ON Z7c1cbemfEBmysAQLV6bUKnk7CfmW4BSGIE6B3mtlr2tXyO5j6zGtks9SjDbBenu9iqBvmg4y5R Q+XtIxomVOg== X-Received: from dlbsn7.prod.google.com ([2002:a05:7022:b907:b0:141:ac8:b5ae]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:6cc:b0:398:9bd5:490d with SMTP id 98e67ed59e1d1-39aee0eafb9mr8976231a91.20.1788364143883; Wed, 02 Sep 2026 08:49:03 -0700 (PDT) Date: Wed, 2 Sep 2026 08:48:53 -0700 In-Reply-To: <20260902154858.2078885-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902154858.2078885-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260902154858.2078885-2-irogers@google.com> Subject: [PATCH v3 1/6] perf tool: Remove util/cache.h From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Tianyou Li , Jiebin Sun , Dapeng Mi , Eric Biggers , Thomas Richter , Stephen Brennan , Swapnil Sapkal , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move definitions to places they are used, or path.h in the case of path.c's mkpath function. Remove unused definitions. Fix transitive include dependencies. Signed-off-by: Ian Rogers --- tools/perf/builtin-annotate.c | 6 +++++- tools/perf/builtin-config.c | 4 +++- tools/perf/builtin-help.c | 3 ++- tools/perf/perf.c | 11 ++++++++++- tools/perf/util/cache.h | 31 ------------------------------ tools/perf/util/config.c | 5 ++++- tools/perf/util/help-unknown-cmd.c | 6 +++++- tools/perf/util/path.c | 2 +- tools/perf/util/path.h | 3 +++ tools/perf/util/strbuf.c | 5 ++++- 10 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 tools/perf/util/cache.h diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 69cb72b2082a..75cbea567196 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -8,10 +8,10 @@ */ #include "builtin.h" #include "perf.h" +#include =20 #include "util/color.h" #include -#include "util/cache.h" #include #include "util/symbol.h" =20 @@ -38,12 +38,16 @@ #include "util/branch.h" #include "util/util.h" #include "ui/progress.h" +#include "ui/ui.h" =20 #include #include #include #include #include +#include +#include +#include =20 struct perf_annotate { struct perf_tool tool; diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c index 237600643bbd..845a8af67fc5 100644 --- a/tools/perf/builtin-config.c +++ b/tools/perf/builtin-config.c @@ -7,14 +7,16 @@ */ #include "builtin.h" =20 -#include "util/cache.h" #include #include "util/debug.h" #include "util/config.h" +#include "util/path.h" #include #include #include #include +#include +#include =20 static bool use_system_config, use_user_config; =20 diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 2692b2e40a23..f0e95d741892 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -4,8 +4,8 @@ * * Builtin help command */ -#include "util/cache.h" #include "util/config.h" +#include "util/path.h" #include "util/strbuf.h" #include "builtin.h" #include @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 1f51e8de6b1b..8ad01a78fdd5 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -10,13 +10,13 @@ #include "perf.h" =20 #include "util/build-id.h" -#include "util/cache.h" #include "util/env.h" #include // page_size #include #include "util/config.h" #include #include "util/parse-events.h" +#include #include #include #include "util/debug.h" @@ -30,7 +30,10 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -39,6 +42,12 @@ #include #include =20 +#define CMD_EXEC_PATH "--exec-path" +#define CMD_DEBUGFS_DIR "--debugfs-dir=3D" + +#define EXEC_PATH_ENVIRONMENT "PERF_EXEC_PATH" +#define PERF_PAGER_ENVIRONMENT "PERF_PAGER" + static int use_pager =3D -1; static FILE *debug_fp =3D NULL; =20 diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h deleted file mode 100644 index 0b61840d4226..000000000000 --- a/tools/perf/util/cache.h +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __PERF_CACHE_H -#define __PERF_CACHE_H - -#include "strbuf.h" -#include -#include "../ui/ui.h" - -#include -#include - -#define CMD_EXEC_PATH "--exec-path" -#define CMD_DEBUGFS_DIR "--debugfs-dir=3D" - -#define EXEC_PATH_ENVIRONMENT "PERF_EXEC_PATH" -#define PERF_DEBUGFS_ENVIRONMENT "PERF_DEBUGFS_DIR" -#define PERF_TRACEFS_ENVIRONMENT "PERF_TRACEFS_DIR" -#define PERF_PAGER_ENVIRONMENT "PERF_PAGER" - -int split_cmdline(char *cmdline, const char ***argv); - -#define alloc_nr(x) (((x)+16)*3/2) - -static inline int is_absolute_path(const char *path) -{ - return path[0] =3D=3D '/'; -} - -char *mkpath(char *path_buf, size_t sz, const char *fmt, ...) __printf(3, = 4); - -#endif /* __PERF_CACHE_H */ diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index 7988149dc7ed..5b696139f655 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c @@ -11,7 +11,6 @@ */ #include #include -#include "cache.h" #include "callchain.h" #include "header.h" #include @@ -19,6 +18,7 @@ #include "util/hist.h" /* perf_hist_config */ #include "util/stat.h" /* perf_stat__set_big_num */ #include "util/evsel.h" /* evsel__hw_names, evsel__use_bpf_counters */ +#include "path.h" #include "srcline.h" #include "build-id.h" #include "debug.h" @@ -26,7 +26,10 @@ #include "unwind.h" #include #include +#include #include +#include +#include #include #include #include diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unkn= own-cmd.c index a0a46e34f8d1..f1cd9d4746f3 100644 --- a/tools/perf/util/help-unknown-cmd.c +++ b/tools/perf/util/help-unknown-cmd.c @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 -#include "cache.h" #include "config.h" #include #include #include +#include #include #include "../builtin.h" #include "levenshtein.h" @@ -36,10 +36,14 @@ static int add_cmd_list(struct cmdnames *cmds, struct c= mdnames *old) =20 if (nr > cmds->alloc) { /* Choose bigger one to alloc */ +#define alloc_nr(x) (((x) + 16) * 3 / 2) + if (alloc_nr(cmds->alloc) < nr) cmds->alloc =3D nr; else cmds->alloc =3D alloc_nr(cmds->alloc); + +#undef alloc_nr tmp =3D realloc(cmds->names, cmds->alloc * sizeof(*cmds->names)); if (!tmp) return -1; diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c index 2e62f272fda8..5ba7861a3e65 100644 --- a/tools/perf/util/path.c +++ b/tools/perf/util/path.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #include "path.h" -#include "cache.h" #include #include +#include #include #include #include diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h index fb850fb55c60..e7cdb0cb1097 100644 --- a/tools/perf/util/path.h +++ b/tools/perf/util/path.h @@ -4,9 +4,12 @@ =20 #include #include +#include =20 struct dirent; =20 +char *mkpath(char *path_buf, size_t sz, const char *fmt, ...) __printf(3, = 4); + int path__join(char *bf, size_t size, const char *path1, const char *path2= ); int path__join3(char *bf, size_t size, const char *path1, const char *path= 2, const char *path3); =20 diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index a64a37628f12..df3f9c4123fd 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#include "cache.h" #include "debug.h" #include "strbuf.h" #include @@ -8,6 +7,7 @@ #include #include #include +#include #include =20 /* @@ -54,9 +54,12 @@ int strbuf_grow(struct strbuf *sb, size_t extra) if (nr <=3D sb->len) return -E2BIG; =20 +#define alloc_nr(x) (((x) + 16) * 3 / 2) + if (alloc_nr(sb->alloc) > nr) nr =3D alloc_nr(sb->alloc); =20 +#undef alloc_nr /* * Note that sb->buf =3D=3D strbuf_slopbuf if sb->alloc =3D=3D 0, and it = is * a static variable. Thus we have to avoid passing it to realloc. --=20 2.55.0.966.g6673acef38-goog From nobody Sat Sep 26 10:01:32 2026 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 424414A92C6 for ; Wed, 2 Sep 2026 15:49:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364149; cv=none; b=eUa3am1sMb5scOUols59Hv9zBEDgE/UBD4SWWLaaYoZ+unv9luYC0agFIGg/i5u+sd8UStjryyqfiKJ8GlS6cSfjxnkgvlXNFJDZ1ZLA40I6/eShDNnFvFrjnx/ihvEm8RNgpdsd5X8V3DfPKsQdRIZBspXPU2cAkC7Ua5sUfkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364149; c=relaxed/simple; bh=5PqBUztHFiiSoVV0MnGN6JdwtV6U4uYa4tZnZmnCjsk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=FhdJQ4B5rHUXbYWmC5XhCiR75VBICSYqfnJXwNWtHmae8FgMTxOl1eAPSkI8+ZZYGj7Roj0Iext4AEpkBfE1+YFIr4OGKLcz9yXs5JckxiredQXtzjaHYTSPu8tlpVHl7St3R5HZ6FBOvkAmAMlxKohzv7hflUQVPkRZG7hVOhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=PXNKTGlH; arc=none smtp.client-ip=209.85.214.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PXNKTGlH" Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2d959904658so23429075ad.2 for ; Wed, 02 Sep 2026 08:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788364146; x=1788968946; darn=vger.kernel.org; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4ts6pjVv6aTNbBmIw4be3JQNIqlAOqk8kSdpUdbRFXk=; b=PXNKTGlHTsK6WdBiOOBR/4hiVmgzIk8mM8Zn0L+GEof3AHKx8LdMd6kbl1TYGMkkex SJSbRmpRAG0BKuWfyFfZpxTgTsck+EN6NSlPV2fdO6teSVfDKsSXt3MKn/1CoGw87+W/ SCLv2teKkhLgpgm75RO1zH8iNVMicvmLckD+KJ3utYoLCHZU5IAyHdk4Swb8GychCKAs p6O2DNmiazYrTuuBeIcr0f+nGHkZD2CAQkdByKFQU7OYtcuuM61fChbrpDrlHeu6+qnI UvYlohHlZZscI7MjYr9T09zeJaTL3SlJhhDaeIiv7uChrzWkNJaJHgz62jJCJgx/4jYl 3wLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788364146; x=1788968946; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4ts6pjVv6aTNbBmIw4be3JQNIqlAOqk8kSdpUdbRFXk=; b=a17A8KlVfcFGRdCvMMMDQxKi6w4WUW6b7XHYfYqZYMC7aonUNV4nJLfhDaRmwwlene A1r/vmrNu2variZpouOs2/+BcjoaxDEyhB37onrc41feOe/i1XEVoF8GGF7/eNuHvPdM fgHiqsaJFsEYnlZmVG6PSaoBxDGeHbgmqLuhWXjNskJN6Gi/31JLKR0lPO4h9f0yV1AL OA2O+JwuZJ5SfZgwfzpHPfrewFg62zlo2Xdxw22ePqN7XNjhaz67ODg7/EYdqjqSEnbS Uz6cos7+TeRiDbS8b13+iuPRJ4RtW3WrgsKE9lsoAfNGOZeR523jDcI6bbH6UpRddf2M tMtQ== X-Forwarded-Encrypted: i=1; AKwUvByDwg4nImZEaf93UjKrbgwtnpsCOQhyQlVJegDrfr2ddQB4eysQWSI6scSUpMr7eY2pSOuNl5r+5in/PHg=@vger.kernel.org X-Gm-Message-State: AFuF++mTe1oQE0yzG4imOjsOaRQRXMiZYiI84Vfj/rY4vpqdq64+kS0k BgUk19qVkmRjSTSrhTMnw7htpHVAokaO90yYupT1MXitLJt/bCsCOV0PfSUs/GH3F3w5VvOgU0g WqxhyDGMaqw== X-Received: from dyz5.prod.google.com ([2002:a05:693c:4085:b0:322:f0d3:b9f1]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e749:b0:2d8:de9f:9a44 with SMTP id d9443c01a7336-2daec732f99mr71539485ad.19.1788364145497; Wed, 02 Sep 2026 08:49:05 -0700 (PDT) Date: Wed, 2 Sep 2026 08:48:54 -0700 In-Reply-To: <20260902154858.2078885-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902154858.2078885-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260902154858.2078885-3-irogers@google.com> Subject: [PATCH v3 2/6] perf tool: Tidy up util/cache.h header file users From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Tianyou Li , Jiebin Sun , Dapeng Mi , Eric Biggers , Thomas Richter , Stephen Brennan , Swapnil Sapkal , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use git clang-format to sort header files. Review header file includes removing those that were unnecessary or adding explicit includes in cases where transitive dependencies were be using. Signed-off-by: Ian Rogers Assisted-by: Antigravity:gemini-3.1-pro --- tools/perf/builtin-annotate.c | 53 ++++++++++++++---------------- tools/perf/builtin-config.c | 18 +++++----- tools/perf/builtin-help.c | 31 ++++++++--------- tools/perf/perf.c | 45 +++++++++++-------------- tools/perf/util/config.c | 39 ++++++++++++---------- tools/perf/util/help-unknown-cmd.c | 9 +++-- tools/perf/util/path.c | 8 ++--- tools/perf/util/path.h | 3 +- tools/perf/util/strbuf.c | 9 ++--- 9 files changed, 109 insertions(+), 106 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 75cbea567196..f208ff513238 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -6,48 +6,45 @@ * look up and read DSOs and symbol information and display * a histogram of results, along various sorting keys. */ -#include "builtin.h" -#include "perf.h" +#include +#include #include +#include +#include +#include =20 -#include "util/color.h" +#include +#include +#include #include #include -#include "util/symbol.h" =20 -#include "util/debug.h" +#include =20 -#include "util/evlist.h" -#include "util/evsel.h" -#include "util/annotate.h" +#include "arch/common.h" +#include "builtin.h" +#include "perf.h" +#include "ui/progress.h" +#include "ui/ui.h" #include "util/annotate-data.h" +#include "util/annotate.h" +#include "util/block-range.h" +#include "util/branch.h" +#include "util/data.h" +#include "util/debug.h" +#include "util/dso.h" #include "util/event.h" -#include -#include "util/parse-events.h" -#include "util/sort.h" +#include "util/evlist.h" +#include "util/evsel.h" #include "util/hist.h" -#include "util/dso.h" #include "util/machine.h" #include "util/map.h" +#include "util/map_symbol.h" #include "util/session.h" +#include "util/sort.h" +#include "util/symbol.h" #include "util/tool.h" -#include "util/data.h" -#include "arch/common.h" -#include "util/block-range.h" -#include "util/map_symbol.h" -#include "util/branch.h" #include "util/util.h" -#include "ui/progress.h" -#include "ui/ui.h" - -#include -#include -#include -#include -#include -#include -#include -#include =20 struct perf_annotate { struct perf_tool tool; diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c index 845a8af67fc5..cefd042e4f85 100644 --- a/tools/perf/builtin-config.c +++ b/tools/perf/builtin-config.c @@ -5,19 +5,21 @@ * Copyright (C) 2015, Taeung Song * */ -#include "builtin.h" - -#include -#include "util/debug.h" -#include "util/config.h" -#include "util/path.h" -#include #include +#include #include #include -#include #include =20 +#include + +#include + +#include "builtin.h" +#include "util/config.h" +#include "util/debug.h" +#include "util/path.h" + static bool use_system_config, use_user_config; =20 static const char * const config_usage[] =3D { diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index f0e95d741892..5bbdb4d9b9c0 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -4,29 +4,30 @@ * * Builtin help command */ -#include "util/config.h" -#include "util/path.h" -#include "util/strbuf.h" -#include "builtin.h" -#include -#include -#include -#include -#include "util/debug.h" -#include "util/util.h" -#include -#include -#include #include #include +#include #include #include -#include #include -#include + +#include +#include #include #include =20 +#include +#include +#include +#include + +#include "builtin.h" +#include "util/config.h" +#include "util/debug.h" +#include "util/path.h" +#include "util/strbuf.h" +#include "util/util.h" + static struct man_viewer_list { struct man_viewer_list *next; char name[0]; diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 8ad01a78fdd5..53c50cfd92d6 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -6,41 +6,36 @@ * This is the main hub from which the sub-commands (perf stat, * perf top, perf record, perf report, etc.) are started. */ -#include "builtin.h" #include "perf.h" =20 -#include "util/build-id.h" -#include "util/env.h" -#include // page_size -#include -#include "util/config.h" -#include -#include "util/parse-events.h" -#include -#include -#include -#include "util/debug.h" -#include "util/event.h" -#include "util/util.h" // usage() -#include "ui/ui.h" -#include "perf-sys.h" -#include -#include -#include #include -#include #include +#include #include #include #include -#include #include -#include -#include -#include -#include + #include #include +#include + +#include +#include // page_size +#include +#include +#include +#include +#include +#include + +#include "builtin.h" +#include "perf-sys.h" +#include "ui/ui.h" +#include "util/build-id.h" +#include "util/config.h" +#include "util/debug.h" +#include "util/util.h" // usage() =20 #define CMD_EXEC_PATH "--exec-path" #define CMD_DEBUGFS_DIR "--debugfs-dir=3D" diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index 5b696139f655..b2972c35c1ec 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c @@ -9,31 +9,34 @@ * Copyright (C) Johannes Schindelin, 2005 * */ +#include "config.h" + #include +#include +#include +#include +#include + +#include +#include +#include #include +#include +#include + +#include + +#include "build-id.h" #include "callchain.h" +#include "debug.h" #include "header.h" -#include -#include "util/event.h" /* proc_map_timeout */ -#include "util/hist.h" /* perf_hist_config */ -#include "util/stat.h" /* perf_stat__set_big_num */ -#include "util/evsel.h" /* evsel__hw_names, evsel__use_bpf_counters */ #include "path.h" #include "srcline.h" -#include "build-id.h" -#include "debug.h" -#include "config.h" #include "unwind.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "util/event.h" /* proc_map_timeout */ +#include "util/evsel.h" /* evsel__hw_names, evsel__use_bpf_counters */ +#include "util/hist.h" /* perf_hist_config */ +#include "util/stat.h" /* perf_stat__set_big_num */ =20 #define MAXNAME (256) =20 diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unkn= own-cmd.c index f1cd9d4746f3..64dbe6e514f5 100644 --- a/tools/perf/util/help-unknown-cmd.c +++ b/tools/perf/util/help-unknown-cmd.c @@ -1,13 +1,16 @@ // SPDX-License-Identifier: GPL-2.0 -#include "config.h" -#include #include #include #include + +#include +#include + #include + #include "../builtin.h" +#include "config.h" #include "levenshtein.h" -#include =20 static int autocorrect; =20 diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c index 5ba7861a3e65..b7592e16718d 100644 --- a/tools/perf/util/path.c +++ b/tools/perf/util/path.c @@ -1,14 +1,14 @@ // SPDX-License-Identifier: GPL-2.0 #include "path.h" -#include + #include #include #include #include -#include -#include + #include -#include +#include +#include =20 static char *cleanup_path(char *path) { diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h index e7cdb0cb1097..62e86d390589 100644 --- a/tools/perf/util/path.h +++ b/tools/perf/util/path.h @@ -2,8 +2,9 @@ #ifndef _PERF_PATH_H #define _PERF_PATH_H =20 -#include #include +#include + #include =20 struct dirent; diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index df3f9c4123fd..4080bc02a533 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c @@ -1,15 +1,16 @@ // SPDX-License-Identifier: GPL-2.0 -#include "debug.h" #include "strbuf.h" -#include -#include -#include + #include #include #include #include + +#include #include =20 +#include "debug.h" + /* * Used as the default ->buf value, so that people can always assume * buf is non NULL and ->buf is NUL terminated even for a freshly --=20 2.55.0.966.g6673acef38-goog From nobody Sat Sep 26 10:01:32 2026 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7A914A92F3 for ; Wed, 2 Sep 2026 15:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364150; cv=none; b=OafIKP47M9riK7+ZAnh8XoTarBodggtfEoFAGoyCjnuRVx83ZVfrYiIq9xBd+5L4JpnEmpFjV0f3OQZ+9sI1+EGiZph8sRSQzkmhkhZCyg2dpdIEB5k4qV7OkjLl63ZgdDba1uQFTrVyttgN8IKFii8UZKZXSsT+4ZgK6u9VyMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364150; c=relaxed/simple; bh=MXekJXZ5T2i1lOP5yjKvUmgkVu177dnr4EEiTiMxEyo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=uaf7TDAzWIzawBoodPtxXINBF//qhOvw+B5GbXteCVvCeldlGu2mrlzBy2ynvOGO6TynenYiI18YU0yxTHNL7T26rFpRSk91FHBuVyF9VbPoazNFjQMFXpYBvS/ByXzFZ8hDf5go0a6z10nGHc8T7bunKKFgM/ibmV+ZMVXLd64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ZgTayEbk; arc=none smtp.client-ip=209.85.216.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZgTayEbk" Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-381250979d5so1593007a91.0 for ; Wed, 02 Sep 2026 08:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788364148; x=1788968948; darn=vger.kernel.org; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tUrm+ROxdJ59YfAdcXGaIH4WCqzrRXNZfGKynOJVM1Q=; b=ZgTayEbk4mi76BuvDGlNvumMkosB0pvqVbWpfSIZJwLEip9T0WHsg3NYqzrDn1GNRF YcaXoSfjJU+13X50nRtA9Im1Si/S76ncNtofn3PzlZWL7Wceo2fUJWIGKkerwAEp5xJC RRpl+QHy0psxeuOB1PKGPuOHH7tZM03T9GyoHqEEaLWDVpBtkqMzdLaTnAH6rnjxgwYm a/oaaTRHg2mjECEmO8uIFWhYMog/qdR9wB/bT4jSb2cw01uY6xRbYOjJLJVMhyswi4i+ IKzGNAjw5eA7638LRuhHHPnO6l87bx1cppnN3DpkfIvvn/eLremswpfs5P2VX8uq5oZz YuUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788364148; x=1788968948; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tUrm+ROxdJ59YfAdcXGaIH4WCqzrRXNZfGKynOJVM1Q=; b=rLDl4HbqJoMPeRF2Dtwhk/q+tcvWhTUpCLehIA0vWXn31Jw6acNUdH3K5zfmhzt4Q4 aukAD97fh2zMp/pLXShpw3N0sOkr0nKbEPyjAeToUsVKFQna9RyN/C6a9FnOJc+LctmQ W9s4ZXXPWmUJ/FzPaCzqIFAIAK5F+h5cNU08O0Pmc2XTGHkbFXHjyXgaSFug5l4DYsf9 eBRzcjb9Of+FcAUOoS1wWm5WbZ/UxHyeALxUE20ATsbL86QpY7CAIaymOfEE3bDp2i3M 0LkBEc80+92YJvGv5ne9TBrg/iy3vPgrmUNxFMBOkLFUR8V9vfpqDeb7+Dplobmr8Zl5 fggA== X-Forwarded-Encrypted: i=1; AKwUvBxF91GbazRvdTC0nAWlI+LtnLz5wvRfcFJ61E3371o6NuV7aYr47TJSyu5F4Sfdd/kDXpN8SjcNKX+hb0k=@vger.kernel.org X-Gm-Message-State: AFuF++kMgepxRFz1pBku1GEq+i3g05ypZ+Y1pEQwCFQ7jmB1OyePZN9F IKQoX3gOrkXB/poEUaJyfQU4am9M5Ssm0Fk7K1koLPglM6ZjNLBLqO4Y9QGHN/YZsxlTyi4s+Rb 30JKy1gWHWw== X-Received: from dybmh46.prod.google.com ([2002:a05:7301:f2e:b0:30f:2f43:117b]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2d4f:b0:37f:e1b6:4c7d with SMTP id 98e67ed59e1d1-39aedf1aec2mr9151888a91.6.1788364147549; Wed, 02 Sep 2026 08:49:07 -0700 (PDT) Date: Wed, 2 Sep 2026 08:48:55 -0700 In-Reply-To: <20260902154858.2078885-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902154858.2078885-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260902154858.2078885-4-irogers@google.com> Subject: [PATCH v3 3/6] perf tool: Remove unused includes in perf.c From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Tianyou Li , Jiebin Sun , Dapeng Mi , Eric Biggers , Thomas Richter , Stephen Brennan , Swapnil Sapkal , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove perf-sys.h, internal/lib.h (page_size), signal.h, and perf.h since their exports are not used directly in perf.c. Signed-off-by: Ian Rogers Assisted-by: Antigravity:gemini-3.1-pro --- tools/perf/perf.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 53c50cfd92d6..7e2e667b011f 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -6,10 +6,8 @@ * This is the main hub from which the sub-commands (perf stat, * perf top, perf record, perf report, etc.) are started. */ -#include "perf.h" =20 #include -#include #include #include #include @@ -21,7 +19,6 @@ #include =20 #include -#include // page_size #include #include #include @@ -30,7 +27,6 @@ #include =20 #include "builtin.h" -#include "perf-sys.h" #include "ui/ui.h" #include "util/build-id.h" #include "util/config.h" --=20 2.55.0.966.g6673acef38-goog From nobody Sat Sep 26 10:01:32 2026 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4941A4A92F4 for ; Wed, 2 Sep 2026 15:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364152; cv=none; b=donsQvymtjO3RNRLnJYgxvRHMQuWpZSOxseukGiUYMcQzrNy8I1Yd+yXUFVrlheWKkH4GXvRmjdjC5BKoddceZ56mSzo8VF2qudJzgOkhw7srXeDrZeq9wiq0BwXrREtl5FQ3oKN/bhTz3YWqjwI0OrNXgitk+HOTYsCs0Vc0jQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364152; c=relaxed/simple; bh=LTTLra+PUz1AlKXy3o92mh9nNm1O1hcLy9+oY8eA8M8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=YjKWIjFdq4xxAgIqJc0FBwwCbKUIdTOeoCSJgWeHHdw8pWWUKGlbN0OllKpmi+6LjvlrowNDBFme3cCWu317dYhKq9Bf6pJkDGZ6bWus1uvcxbBMps3ed/aG1vAhenRfYA5BF+KskgmEWjq9ZG6hHz26m9bt4y0wLd9uIyhpUWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sSyojTa1; arc=none smtp.client-ip=209.85.214.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sSyojTa1" Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2d6c166bafcso19520895ad.2 for ; Wed, 02 Sep 2026 08:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788364150; x=1788968950; darn=vger.kernel.org; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zhk15Dkp6U70e7pfSeMd4e+aP7RD0YHiViMj7ADpkzQ=; b=sSyojTa1ktrLg2Br0nVpRSYkhl9YMmpVqb72emIr0jj8JZallUo8t5Pn47vQVly7D6 FFzRoEoJY5mNjazKkIH9EnBrV99K1khBCEX/PM2LCcPPwilRR+7lIhRcKXkQ0u4A1v5E EQgRayX0jwiNXCWbFZvkd8PrvjzFaYhuldEh0+aaVMApC+SBhlQjW0hLrVVWPWdxK4th 8oxMEExRrVLZYbhFQGRxb11Yuql/5R7WNX2vTbZ6sASt1T6CLTgFtPLFa2xmD+9d2odD lxv9CiwXtLRLwoLHsJL8hLkUB5B0PPZ01QFchyWqm9JZ9DfYhlhWv5WlsPBKhFUVymhH vcjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788364150; x=1788968950; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zhk15Dkp6U70e7pfSeMd4e+aP7RD0YHiViMj7ADpkzQ=; b=c24l9GjwlPHnx7hbIsJ0H8Wg0dpa4LR4qZtrv2zjKhapxlXG8LQ3XC+S+QAAsCVbA3 dsLlcA2ZptpmhpgGDeHupcLR8SSuS1VaGqrh/hlJdfmo8jGWBZsTWSP5UDtj/xc7Eesd oxzz9HBN0Xyk3I4/dHZQiolwkqp8gMKxCUp6snFxOfR1NhDcIv3DlWALeHei3fU8eQf2 l4jGklyqMy6IT5WsYfSlVcxfVHYiqefviw7AzRvWp1BHhwwsZBypQUlGFGT52vPYaBIP Qswd5QYv3YIZLp7tJsvRzmU5j5lzKPtw3pCjH9MhVRapEzvKmVxbz/cl7LzOQ+ZeJt4m 1Jxw== X-Forwarded-Encrypted: i=1; AKwUvBw6A7ZNCJA+c0Swjm5iNxND8NU9ULjVEGWplfwCiPLL5xFs9mmVwf27C3OsafIL7tG6DWr/f3uxEt3Jczc=@vger.kernel.org X-Gm-Message-State: AFuF++kd4TvcGguk8ZlbMezPDNhEVkVxTqAStu7+4Gq2K6DHGxMq60b2 dG2lZJ7rDRhPcPMwxWWjq12icE/+HTdNrW98rJiX45v6DCV/Y3hs6/KwG397UYlWHYDMT1RhkKZ RUG9KCf75mg== X-Received: from dycpq12.prod.google.com ([2002:a05:7301:fd0c:b0:327:7dfc:560a]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:53d0:b0:37d:f983:7b5 with SMTP id 98e67ed59e1d1-39aedf779b3mr8820740a91.9.1788364149483; Wed, 02 Sep 2026 08:49:09 -0700 (PDT) Date: Wed, 2 Sep 2026 08:48:56 -0700 In-Reply-To: <20260902154858.2078885-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902154858.2078885-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260902154858.2078885-5-irogers@google.com> Subject: [PATCH v3 4/6] perf tool: Move usage strings and functions to perf.c From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Tianyou Li , Jiebin Sun , Dapeng Mi , Eric Biggers , Thomas Richter , Stephen Brennan , Swapnil Sapkal , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The code is mostly used by perf.c with additional unused functionality such as function pointers derived from early git code. Moving it into perf.c directly reduces the code footprint, drops the util/util.h dependence from perf.c, and allows us to remove util/usage.c entirely. The string constants are exposed in builtin.h, as they are used in builtin-help.c. Signed-off-by: Ian Rogers Assisted-by: Antigravity:gemini-3.1-pro --- tools/perf/builtin.h | 3 +++ tools/perf/perf.c | 13 ++++++++++++- tools/perf/util/Build | 1 - tools/perf/util/usage.c | 34 ---------------------------------- tools/perf/util/util.h | 4 ---- 5 files changed, 15 insertions(+), 40 deletions(-) delete mode 100644 tools/perf/util/usage.c diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h index 40c4078c295f..e0b430821abc 100644 --- a/tools/perf/builtin.h +++ b/tools/perf/builtin.h @@ -2,6 +2,9 @@ #ifndef BUILTIN_H #define BUILTIN_H =20 +extern const char perf_usage_string[]; +extern const char perf_more_info_string[]; + struct feature_status { const char *name; const char *macro; diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 7e2e667b011f..65bdfd71f626 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -31,7 +31,18 @@ #include "util/build-id.h" #include "util/config.h" #include "util/debug.h" -#include "util/util.h" // usage() + +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 void __noreturn usage(const char *err) +{ + fprintf(stderr, "\n Usage: %s\n", err); + exit(129); +} =20 #define CMD_EXEC_PATH "--exec-path" #define CMD_DEBUGFS_DIR "--debugfs-dir=3D" diff --git a/tools/perf/util/Build b/tools/perf/util/Build index b26a0b1ddfa3..d08f2af7d970 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -54,7 +54,6 @@ perf-util-y +=3D string.o perf-util-y +=3D strlist.o perf-util-y +=3D strfilter.o perf-util-y +=3D top.o -perf-util-y +=3D usage.o perf-util-y +=3D dso.o perf-util-y +=3D dsos.o perf-util-y +=3D symbol.o diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c deleted file mode 100644 index 4c8ffbad2323..000000000000 --- a/tools/perf/util/usage.c +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * usage.c - * - * Various reporting routines. - * Originally copied from GIT source. - * - * Copyright (C) Linus Torvalds, 2005 - */ -#include "util.h" -#include -#include -#include - -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); - exit(129); -} - -/* If we are in a dlopen()ed .so write to a global variable would segfault - * (ugh), so keep things static. */ -static void (*usage_routine)(const char *err) __noreturn =3D usage_builtin; - -void usage(const char *err) -{ - usage_routine(err); -} diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 87a0818a8c76..f8f1ff603c72 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -17,9 +17,6 @@ #include #endif =20 -extern const char perf_usage_string[]; -extern const char perf_more_info_string[]; - extern const char *input_name; =20 /* This will control if perf_{host,guest} will set attr.exclude_{host,gues= t}. */ @@ -29,7 +26,6 @@ extern bool perf_host; extern bool perf_guest; =20 /* General helper functions */ -void usage(const char *err) __noreturn; =20 struct dirent; struct strlist; --=20 2.55.0.966.g6673acef38-goog From nobody Sat Sep 26 10:01:32 2026 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 421044AA014 for ; Wed, 2 Sep 2026 15:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364155; cv=none; b=fziiJjMwLOTjnA1sgqNIxlm+OuYATSY4uEAl5mB3NzK8SV92xxm1b7uz0YnijjM3q/VrgfQfcJMwG6bjMXmw4AZ+VwdepXXlHhXM9V9PjVLBUlLF0YjUtb45xzsOlSaKzPOsOq0JyNNppIoYwwuD+uiopR9r4Bmv4dQR8B0pV0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364155; c=relaxed/simple; bh=hcb+YsYktGD5DAT9O/TDu5c3+MGTfAHeFGUSy/g2LNk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=Ie8EbziVOUQijXA1G626Zy4o+206BwZDn4QhcqwUecFYBd/PpTm3RZ6+hO/jMDWfsTtcLxKFbJBuBOGicWiVE3bMKSXBKmxyLwVmJx6bigqtWQuRd4BQvGmnz6Hox/Qme7/jvWjz/eIZABgRSODQRLXvKZA1qJbdb05CmqiKZ4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=D9Ab7Jex; arc=none smtp.client-ip=209.85.215.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="D9Ab7Jex" Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cc12e8e22b7so2943102a12.0 for ; Wed, 02 Sep 2026 08:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788364152; x=1788968952; darn=vger.kernel.org; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vDA7hQcC28A9PrfAF9PzfBXNfTQslOisMIggbz4Lwoc=; b=D9Ab7JexvAClT5ihXA1mVbn/UnLd7YLVsrc3SpA+iING8+FHs6atajArs86+SEGrJM nT7tFh6s600aCcOmHVe4Tv7R/xk86+Nmlz+rEAeM3MY6r6kfcqzaETz/089pmqhci0kh Calh9RRcMHDnAQrr7qp64Aba0qkmS4wFcfSHVOQ/m0bq+y1G2EtKC2qZPKwKVHxv2sad dwmuMwe78YcMfZlIeS4r1pL35WVyD+NmTGDlFzW8Gj39iczcWi9FCxxRT5BDeo5ghHsO 20eQIo4rx6Ja1SvOBp8cTKtlC2vou9wr8xzLqcbHPIsF/MdTBxdeNdnny807SMcFrqBj Fkjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788364152; x=1788968952; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vDA7hQcC28A9PrfAF9PzfBXNfTQslOisMIggbz4Lwoc=; b=MufweexehpXV5E7DvXTa6ayA23oB+hoPEumdN7rvpcnwVzrqqyFKKj2h21Cv4lGKXR UdztjMAI/9yGbRairVTAI4lKF/D10uxKNYCmrRzuMma6BoYCZiTwywzoxbXFab++V6P+ 8mir/nQBJ3oWPYjL9vpEew5SnLv8xVuTjZ5duLHlN1G42AjsY8z7nA4vFF11l3G1BH0v 9sC22qdbdVehqPT0KfyBaBwIMW+6TdItxGBMvSPXfr75IGi060pNP0+CySTtXktvQ2az TUB9jzjAVCyJUtyMU381iecPNNzrhRe5/O8YX09Q2gpTUJneN5iU6emPU2T4uXlXGR37 Liqw== X-Forwarded-Encrypted: i=1; AKwUvBwDvdXpUc1zV2xkd87jF3rOSY7bpCH7TyzbqiIHAiA9L3sHUvwhXsMpxToSTL3txJnlE6at5LUwA2ALJVI=@vger.kernel.org X-Gm-Message-State: AFuF++lspyjbwX3OL4EB5SMosBrFHjUv7v6WuYl3DTB4/we8ycpll/BB Zbfe0hHy0CoXfcEtEKTBzeqPc2KygG9Pb9IfG+CTAsTUrfDl7IJZabLEmzbfttaR4nd24sc9y87 cB7bXbi/tEw== X-Received: from dlag8.prod.google.com ([2002:a05:701b:2508:b0:141:4a59:5b22]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2785:b0:398:9be5:b41e with SMTP id 98e67ed59e1d1-39aee285570mr9664000a91.25.1788364151428; Wed, 02 Sep 2026 08:49:11 -0700 (PDT) Date: Wed, 2 Sep 2026 08:48:57 -0700 In-Reply-To: <20260902154858.2078885-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902154858.2078885-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260902154858.2078885-6-irogers@google.com> Subject: [PATCH v3 5/6] perf tool: Add fallback stubs for missing dependencies From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Tianyou Li , Jiebin Sun , Dapeng Mi , Eric Biggers , Thomas Richter , Stephen Brennan , Swapnil Sapkal , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Declare stubs directly inside perf.c for commands that have library dependencies sometimes omitted at build time, such as libtraceevent (timechart, sched, kmem, lock, trace, kwork) and libelf (probe). By unconditionally including these commands in the commands[] array, users will receive a clear, unified warning indicating the missing dependency instead of the command silently being absent. Running `perf trace` with libtraceevent missing. Before: ``` perf: 'trace' is not a perf-command. See 'perf --help'. Did you mean this? ftrace ``` After: ``` 'trace' command not available: missing libtraceevent devel package at build= time. ``` Signed-off-by: Ian Rogers Assisted-by: Antigravity:gemini-3.1-pro --- tools/perf/perf.c | 51 ++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 65bdfd71f626..6c5baa285b13 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -7,6 +7,7 @@ * perf top, perf record, perf report, etc.) are started. */ =20 +#include #include #include #include @@ -53,6 +54,38 @@ static void __noreturn usage(const char *err) static int use_pager =3D -1; static FILE *debug_fp =3D NULL; =20 + +#ifndef HAVE_LIBTRACEEVENT +#define DECLARE_LIBTRACEEVENT_STUB(_cmd) \ + int cmd_##_cmd(int argc __always_unused, const char **argv __always_unuse= d) \ + { \ + fprintf(stderr, \ + "'" #_cmd "' command not available: missing libtraceevent " \ + "devel package at build time.\n"); \ + return -1; \ + } + +DECLARE_LIBTRACEEVENT_STUB(timechart) +DECLARE_LIBTRACEEVENT_STUB(sched) +DECLARE_LIBTRACEEVENT_STUB(kmem) +DECLARE_LIBTRACEEVENT_STUB(lock) +DECLARE_LIBTRACEEVENT_STUB(trace) +DECLARE_LIBTRACEEVENT_STUB(kwork) +#endif + +#ifndef HAVE_LIBELF_SUPPORT +#define DECLARE_LIBELF_SUPPORT_STUB(_cmd) \ + int cmd_##_cmd(int argc __always_unused, const char **argv __always_unuse= d) \ + { \ + fprintf(stderr, \ + "'" #_cmd "' command not available: missing libelf " \ + "devel package at build time.\n"); \ + return -1; \ + } + +DECLARE_LIBELF_SUPPORT_STUB(probe) +#endif + struct cmd_struct { const char *cmd; int (*fn)(int, const char **); @@ -76,36 +109,24 @@ static const struct cmd_struct commands[] =3D { { "report", cmd_report, 0 }, { "bench", cmd_bench, 0 }, { "stat", cmd_stat, 0 }, -#ifdef HAVE_LIBTRACEEVENT { "timechart", cmd_timechart, 0 }, -#endif { "top", cmd_top, 0 }, { "annotate", cmd_annotate, 0 }, { "version", cmd_version, 0 }, { "script", cmd_script, 0 }, -#ifdef HAVE_LIBTRACEEVENT { "sched", cmd_sched, 0 }, -#endif -#ifdef HAVE_LIBELF_SUPPORT { "probe", cmd_probe, 0 }, -#endif -#ifdef HAVE_LIBTRACEEVENT { "kmem", cmd_kmem, 0 }, { "lock", cmd_lock, 0 }, -#endif { "kvm", cmd_kvm, 0 }, { "test", cmd_test, 0 }, -#if defined(HAVE_LIBTRACEEVENT) { "trace", cmd_trace, 0 }, -#endif { "inject", cmd_inject, 0 }, { "mem", cmd_mem, 0 }, { "data", cmd_data, 0 }, { "ftrace", cmd_ftrace, 0 }, { "daemon", cmd_daemon, 0 }, -#ifdef HAVE_LIBTRACEEVENT { "kwork", cmd_kwork, 0 }, -#endif }; =20 struct pager_config { @@ -514,15 +535,9 @@ int main(int argc, const char **argv) argv[0] =3D cmd; } if (strstarts(cmd, "trace")) { -#ifndef HAVE_LIBTRACEEVENT - fprintf(stderr, - "trace command not available: missing libtraceevent devel package at bu= ild time.\n"); - goto out; -#else setup_path(); argv[0] =3D "trace"; return cmd_trace(argc, argv); -#endif } /* Look for flags.. */ argv++; --=20 2.55.0.966.g6673acef38-goog From nobody Sat Sep 26 10:01:32 2026 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D778A4AA026 for ; Wed, 2 Sep 2026 15:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364157; cv=none; b=hGep3/TOHOvvDG8b23gfQ7yzhoKm2xpkkvhq3Cm618AcxZ2LN5mm/sDdbwezSsH1hHhXQauCysD3Vz8WqiXo0te+/mAVluDD3Nvwq8JMRJLR5bOR7gghxfpUa3mP0XWsSRuRlacVadggrgpdY/HBPdmIq3vfME2gLwjsgq3AhSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788364157; c=relaxed/simple; bh=0rHOZoRobN/My/uaUo/taCIKk/nrLMB8OuXHYhWB9Q8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=A3payULfMj/+6F0C8XUreDCqVXeRwR6CpnJcddN7GnnKeS5NLmp2OII6co19aR7W2Wsk58X5k6/Lbc4h58tOnBda86GdpCN30TWk6uM/f7IqBI95nNRoeIC2aicZDAKuSmCdYiWrq4ZiuAbre1J8U0dJ2r90BDK9u5KJhRZMfZE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pYJ8FKex; arc=none smtp.client-ip=209.85.216.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pYJ8FKex" Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-398d292eac1so2503906a91.1 for ; Wed, 02 Sep 2026 08:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788364154; x=1788968954; darn=vger.kernel.org; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HlO9J/OYs/VWmsx5/JTVY1hRLPz5HlVbyPwG8syJOco=; b=pYJ8FKexkoISdSpA7BHKigvVZVNZAfQnDLEpBSmWswDuN9AdrPQ8pdf+ZoPhIzK95X jC/CZ+ztIBQ2xQC6PF2Xy1RSM5dKCVOU2Nq4UiZIt/J5wForY+yGcmg6GtUFC7MGh/6U SBG3HBrWkn4IYsPjsqAz/4EC7muuSdDgha/BDXJAa9KJEbYVT/3XLn/VFHHECpgvb0S4 ZCka2e19NM0f18mXSbSea1SOKpp2cprJGcRvVWR2OUnEbeZr2q1q/gxX2bI33sOSgQcT 2dkyN4eGdGOngJbXqS4zfjfRkOOTyhdKhIVN/CegbKgnHbAu5xL8wOCVZ9sNXooFLfcX SXNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788364154; x=1788968954; h=content-type:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HlO9J/OYs/VWmsx5/JTVY1hRLPz5HlVbyPwG8syJOco=; b=g6npmMwU3FF3sUOU85JOahJSvus1YPmV+gnRQ15XK8py2WhIBRcRWNRrzF/Z20iK0f vNijDD5YCPURhtO3IUOWjwn/Ho67UzUGwQOgddL8ImBT63gzY4SHdPRzOSFWRbHH5oiR DheiB5H/EYqAnjaL2DgAGBy7ld1umwqXHBTTGAVuc7dTMt+VlNc1dvCiLebD5ZEKWtXL 7ingd5sTUmAqy2482J4+wNrvqwWkGqj1/m5vNQ6fOwYQ/wI6Lxsx0wbuzhQ6zZ4j5FBY oiVntsdB8vR1gNZDzgQxjcvYY1U8jOTsvQmWH+QCLWF8RlQwXjoJhQBTmJQ0JDRZtWiI Yt9g== X-Forwarded-Encrypted: i=1; AKwUvBxyMDDaoIvRmrGW1RFUIBwSsJtWa4AxpFKCX3TYqxxIFLshqLPqZnEHroxSzy4FEFu4sgpWK1G9Ttb/sso=@vger.kernel.org X-Gm-Message-State: AFuF++lFKINkFndG6Ik4sG59UUfVgEiPiyk/C8+EjCf9ykHNa/x9OUY5 hAzEGjh4Rpl6cX0ut7alxbG2LuBDMwdGwZ8EN/uXzJ2H0lspp6pUbVDcP14Uawu60ZEJHNM7gj2 0TW2dTZu7Ag== X-Received: from dltt5.prod.google.com ([2002:a05:701a:c965:b0:141:a317:d828]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:524c:b0:390:8361:a532 with SMTP id 98e67ed59e1d1-39aedfb8ebcmr8928932a91.7.1788364153348; Wed, 02 Sep 2026 08:49:13 -0700 (PDT) Date: Wed, 2 Sep 2026 08:48:58 -0700 In-Reply-To: <20260902154858.2078885-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260902154858.2078885-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260902154858.2078885-7-irogers@google.com> Subject: [PATCH v3 6/6] perf hist: Remove keysym.h include from hist.h From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Tianyou Li , Jiebin Sun , Dapeng Mi , Eric Biggers , Thomas Richter , Stephen Brennan , Swapnil Sapkal , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" hist.h isn't related to UI and so remove the UI inclusion. Fix the transitive dependency issues this exposes. Signed-off-by: Ian Rogers --- tools/perf/builtin-annotate.c | 8 ++++++++ tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-kvm.c | 1 + tools/perf/builtin-report.c | 1 + tools/perf/builtin-top.c | 1 + tools/perf/ui/browsers/annotate.c | 1 + tools/perf/ui/browsers/hists.c | 1 + tools/perf/ui/browsers/scripts.c | 1 + tools/perf/ui/libslang.h | 2 ++ tools/perf/util/hist.h | 6 ------ 10 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index f208ff513238..a4c014a1d28f 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -24,6 +24,7 @@ #include "arch/common.h" #include "builtin.h" #include "perf.h" +#include "ui/keysyms.h" #include "ui/progress.h" #include "ui/ui.h" #include "util/annotate-data.h" @@ -46,6 +47,13 @@ #include "util/tool.h" #include "util/util.h" =20 +#ifndef HAVE_SLANG_SUPPORT +#undef K_LEFT +#define K_LEFT -1000 +#undef K_RIGHT +#define K_RIGHT -2000 +#endif + struct perf_annotate { struct perf_tool tool; struct perf_session *session; diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 715b75d42f2a..6b64c0d6b24f 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -49,6 +49,7 @@ #include "thread.h" #include "tool.h" #include "ui/browsers/hists.h" +#include "ui/keysyms.h" #include "ui/progress.h" #include "ui/ui.h" #include "util/annotate.h" diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index b9f6cb71c0a0..c5e82c078848 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -27,6 +27,7 @@ #include "util/kvm-stat.h" #include "util/util.h" #include "ui/browsers/hists.h" +#include "ui/keysyms.h" #include "ui/progress.h" #include "ui/ui.h" #include "util/string2.h" diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 60d1f166629e..6f4ad5fa536d 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -51,6 +51,7 @@ #include "util/units.h" #include "util/unwind.h" #include "util/util.h" // perf_tip() +#include "ui/keysyms.h" #include "ui/ui.h" #include "ui/progress.h" #include "util/block-info.h" diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 570410599f1b..44ba67e53cf1 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -51,6 +51,7 @@ #include "util/intlist.h" #include "util/parse-branch-options.h" #include "arch/common.h" +#include "ui/keysyms.h" #include "ui/ui.h" =20 #include "util/debug.h" diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/ann= otate.c index e47a46775089..61ffdc52933d 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "../browser.h" #include "../helpline.h" +#include "../keysyms.h" #include "../ui.h" #include "../../util/annotate.h" #include "../../util/debug.h" diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index c15874a491b4..f62cb2d534ed 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -35,6 +35,7 @@ =20 #include "../browsers/hists.h" #include "../helpline.h" +#include "../keysyms.h" #include "../util.h" #include "../ui.h" #include "map.h" diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scri= pts.c index 1e8c2c2f952d..94cc1f427c96 100644 --- a/tools/perf/ui/browsers/scripts.c +++ b/tools/perf/ui/browsers/scripts.c @@ -7,6 +7,7 @@ #include "../../util/session.h" #include "../../util/symbol.h" #include "../browser.h" +#include "../keysyms.h" #include "../libslang.h" #include "config.h" #include diff --git a/tools/perf/ui/libslang.h b/tools/perf/ui/libslang.h index 6722561e0458..dd6b9f192155 100644 --- a/tools/perf/ui/libslang.h +++ b/tools/perf/ui/libslang.h @@ -15,7 +15,9 @@ #define ENABLE_SLFUTURE_CONST 1 #define ENABLE_SLFUTURE_VOID 1 =20 +#ifdef HAVE_SLANG_SUPPORT #include +#endif =20 #define SL_KEY_UNTAB 0x1000 =20 diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index b830cbe7f95b..b30375a203e7 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -714,7 +714,6 @@ struct block_hist { #define NO_ADDR 0 =20 #ifdef HAVE_SLANG_SUPPORT -#include "../ui/keysyms.h" void attr_to_script(char *buf, struct perf_event_attr *attr); =20 int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *m= s, @@ -787,11 +786,6 @@ static inline int block_hists_tui_browse(struct block_= hist *bh __maybe_unused, { return 0; } - -#define K_LEFT -1000 -#define K_RIGHT -2000 -#define K_SWITCH_INPUT_DATA -3000 -#define K_RELOAD -4000 #endif =20 unsigned int hists__sort_list_width(struct hists *hists); --=20 2.55.0.966.g6673acef38-goog