* [PATCH v1 1/2] perf tool: Remove util/cache.h
@ 2026-08-28 22:20 Ian Rogers
2026-08-28 22:20 ` [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal Ian Rogers
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Ian Rogers @ 2026-08-28 22:20 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Jiri Olsa, Ian Rogers, Adrian Hunter, James Clark,
Thomas Richter, linux-kernel, linux-perf-users
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 <irogers@google.com>
---
tools/perf/builtin-annotate.c | 2 +-
tools/perf/builtin-config.c | 2 +-
tools/perf/builtin-help.c | 2 +-
tools/perf/perf.c | 8 +++++++-
tools/perf/util/cache.h | 31 ------------------------------
tools/perf/util/config.c | 2 +-
tools/perf/util/help-unknown-cmd.c | 6 +++++-
tools/perf/util/path.c | 1 -
tools/perf/util/path.h | 3 +++
tools/perf/util/strbuf.c | 4 +++-
10 files changed, 22 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..3efeb845099c 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -11,7 +11,6 @@
#include "util/color.h"
#include <linux/list.h>
-#include "util/cache.h"
#include <linux/rbtree.h>
#include "util/symbol.h"
@@ -38,6 +37,7 @@
#include "util/branch.h"
#include "util/util.h"
#include "ui/progress.h"
+#include "ui/ui.h"
#include <dlfcn.h>
#include <errno.h>
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index 237600643bbd..f4f916241d1d 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -7,10 +7,10 @@
*/
#include "builtin.h"
-#include "util/cache.h"
#include <subcmd/parse-options.h>
#include "util/debug.h"
#include "util/config.h"
+#include "util/path.h"
#include <linux/string.h>
#include <limits.h>
#include <stdio.h>
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 2692b2e40a23..36f5c5e94289 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 <subcmd/exec-cmd.h>
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 1f51e8de6b1b..ad8c8067b765 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -10,13 +10,13 @@
#include "perf.h"
#include "util/build-id.h"
-#include "util/cache.h"
#include "util/env.h"
#include <internal/lib.h> // page_size
#include <subcmd/exec-cmd.h>
#include "util/config.h"
#include <subcmd/run-command.h>
#include "util/parse-events.h"
+#include <subcmd/pager.h>
#include <subcmd/parse-options.h>
#include <subcmd/help.h>
#include "util/debug.h"
@@ -39,6 +39,12 @@
#include <linux/string.h>
#include <linux/zalloc.h>
+#define CMD_EXEC_PATH "--exec-path"
+#define CMD_DEBUGFS_DIR "--debugfs-dir="
+
+#define EXEC_PATH_ENVIRONMENT "PERF_EXEC_PATH"
+#define PERF_PAGER_ENVIRONMENT "PERF_PAGER"
+
static int use_pager = -1;
static FILE *debug_fp = NULL;
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 <subcmd/pager.h>
-#include "../ui/ui.h"
-
-#include <linux/compiler.h>
-#include <linux/string.h>
-
-#define CMD_EXEC_PATH "--exec-path"
-#define CMD_DEBUGFS_DIR "--debugfs-dir="
-
-#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] == '/';
-}
-
-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..6a310e56a2f1 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -11,7 +11,6 @@
*/
#include <errno.h>
#include <sys/param.h>
-#include "cache.h"
#include "callchain.h"
#include "header.h"
#include <subcmd/exec-cmd.h>
@@ -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"
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-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 <poll.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <subcmd/help.h>
#include "../builtin.h"
#include "levenshtein.h"
@@ -36,10 +36,14 @@ static int add_cmd_list(struct cmdnames *cmds, struct cmdnames *old)
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 = nr;
else
cmds->alloc = alloc_nr(cmds->alloc);
+
+#undef alloc_nr
tmp = 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..bf5d081707e4 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include "path.h"
-#include "cache.h"
#include <linux/kernel.h>
#include <limits.h>
#include <stdio.h>
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 @@
#include <stddef.h>
#include <stdbool.h>
+#include <linux/compiler.h>
struct dirent;
+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 *path2, const char *path3);
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index a64a37628f12..7b94aa1e5ade 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 <linux/kernel.h>
@@ -54,9 +53,12 @@ int strbuf_grow(struct strbuf *sb, size_t extra)
if (nr <= sb->len)
return -E2BIG;
+#define alloc_nr(x) (((x) + 16) * 3 / 2)
+
if (alloc_nr(sb->alloc) > nr)
nr = alloc_nr(sb->alloc);
+#undef alloc_nr
/*
* Note that sb->buf == strbuf_slopbuf if sb->alloc == 0, and it is
* a static variable. Thus we have to avoid passing it to realloc.
--
2.55.0.897.gb25b4bd76c-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal
2026-08-28 22:20 [PATCH v1 1/2] perf tool: Remove util/cache.h Ian Rogers
@ 2026-08-28 22:20 ` Ian Rogers
2026-08-28 22:27 ` sashiko-bot
2026-08-28 22:36 ` [PATCH v1 1/2] perf tool: Remove util/cache.h sashiko-bot
2026-08-31 18:22 ` [PATCH v2 " Ian Rogers
2 siblings, 1 reply; 8+ messages in thread
From: Ian Rogers @ 2026-08-28 22:20 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Jiri Olsa, Ian Rogers, Adrian Hunter, James Clark,
Thomas Richter, linux-kernel, linux-perf-users
Use git clang-format to sort headers.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/builtin-annotate.c | 49 +++++++++++++++---------------
tools/perf/builtin-config.c | 14 +++++----
tools/perf/builtin-help.c | 31 ++++++++++---------
tools/perf/perf.c | 49 ++++++++++++++++--------------
tools/perf/util/config.c | 34 ++++++++++++---------
tools/perf/util/help-unknown-cmd.c | 9 ++++--
tools/perf/util/path.c | 8 +++--
tools/perf/util/path.h | 3 +-
8 files changed, 107 insertions(+), 90 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 3efeb845099c..fbdcfae858e2 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -6,44 +6,43 @@
* 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 <errno.h>
+#include <inttypes.h>
-#include "util/color.h"
+#include <dlfcn.h>
+#include <linux/bitmap.h>
+#include <linux/err.h>
#include <linux/list.h>
#include <linux/rbtree.h>
-#include "util/symbol.h"
-#include "util/debug.h"
+#include <subcmd/parse-options.h>
-#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/color.h"
+#include "util/data.h"
+#include "util/debug.h"
+#include "util/dso.h"
#include "util/event.h"
-#include <subcmd/parse-options.h>
-#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/parse-events.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 <dlfcn.h>
-#include <errno.h>
-#include <linux/bitmap.h>
-#include <linux/err.h>
-#include <inttypes.h>
struct perf_annotate {
struct perf_tool tool;
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index f4f916241d1d..1ee5461436b6 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -5,16 +5,18 @@
* Copyright (C) 2015, Taeung Song <treeze.taeung@gmail.com>
*
*/
-#include "builtin.h"
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <linux/string.h>
#include <subcmd/parse-options.h>
-#include "util/debug.h"
+
+#include "builtin.h"
#include "util/config.h"
+#include "util/debug.h"
#include "util/path.h"
-#include <linux/string.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
static bool use_system_config, use_user_config;
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 36f5c5e94289..676a0bb63b24 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -4,28 +4,31 @@
*
* Builtin help command
*/
-#include "util/config.h"
-#include "util/path.h"
-#include "util/strbuf.h"
-#include "builtin.h"
-#include <subcmd/exec-cmd.h>
-#include <subcmd/parse-options.h>
-#include <subcmd/run-command.h>
-#include <subcmd/help.h>
-#include "util/debug.h"
-#include "util/util.h"
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/zalloc.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
+
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/zalloc.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
+#include <subcmd/exec-cmd.h>
+#include <subcmd/help.h>
+#include <subcmd/parse-options.h>
+#include <subcmd/run-command.h>
+
+#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 ad8c8067b765..99135d17b85c 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -6,38 +6,41 @@
* 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"
-#include "util/build-id.h"
-#include "util/env.h"
-#include <internal/lib.h> // page_size
-#include <subcmd/exec-cmd.h>
-#include "util/config.h"
-#include <subcmd/run-command.h>
-#include "util/parse-events.h"
-#include <subcmd/pager.h>
-#include <subcmd/parse-options.h>
-#include <subcmd/help.h>
-#include "util/debug.h"
-#include "util/event.h"
-#include "util/util.h" // usage()
-#include "ui/ui.h"
-#include "perf-sys.h"
-#include <api/fs/fs.h>
-#include <api/fs/tracing_path.h>
-#include <perf/core.h>
#include <errno.h>
-#include <pthread.h>
#include <signal.h>
#include <stdlib.h>
#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
+
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/zalloc.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <api/fs/fs.h>
+#include <api/fs/tracing_path.h>
+#include <internal/lib.h> // page_size
+#include <perf/core.h>
+#include <subcmd/exec-cmd.h>
+#include <subcmd/help.h>
+#include <subcmd/pager.h>
+#include <subcmd/parse-options.h>
+#include <subcmd/run-command.h>
+
+#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/env.h"
+#include "util/event.h"
+#include "util/parse-events.h"
+#include "util/util.h" // usage()
#define CMD_EXEC_PATH "--exec-path"
#define CMD_DEBUGFS_DIR "--debugfs-dir="
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 6a310e56a2f1..a748c9fd629e 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -9,28 +9,32 @@
* Copyright (C) Johannes Schindelin, 2005
*
*/
+#include "config.h"
+
#include <errno.h>
+#include <stdlib.h>
+
+#include <linux/ctype.h>
+#include <linux/string.h>
+#include <linux/zalloc.h>
#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <subcmd/exec-cmd.h>
+
+#include "build-id.h"
#include "callchain.h"
+#include "debug.h"
#include "header.h"
-#include <subcmd/exec-cmd.h>
-#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 <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <linux/string.h>
-#include <linux/zalloc.h>
-#include <linux/ctype.h>
+#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 */
#define MAXNAME (256)
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-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 <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include <linux/zalloc.h>
+#include <poll.h>
+
#include <subcmd/help.h>
+
#include "../builtin.h"
+#include "config.h"
#include "levenshtein.h"
-#include <linux/zalloc.h>
static int autocorrect;
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index bf5d081707e4..7e85bbd8f751 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -1,12 +1,14 @@
// SPDX-License-Identifier: GPL-2.0
#include "path.h"
-#include <linux/kernel.h>
+
#include <limits.h>
#include <stdio.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
#include <dirent.h>
+#include <linux/kernel.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
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
-#include <stddef.h>
#include <stdbool.h>
+#include <stddef.h>
+
#include <linux/compiler.h>
struct dirent;
--
2.55.0.897.gb25b4bd76c-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal
2026-08-28 22:20 ` [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal Ian Rogers
@ 2026-08-28 22:27 ` sashiko-bot
0 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-08-28 22:27 UTC (permalink / raw)
To: Ian Rogers; +Cc: linux-perf-users
> Use git clang-format to sort headers.
>
> Signed-off-by: Ian Rogers <irogers@google.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828222045.1314766-1-irogers@google.com?part=2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/2] perf tool: Remove util/cache.h
2026-08-28 22:20 [PATCH v1 1/2] perf tool: Remove util/cache.h Ian Rogers
2026-08-28 22:20 ` [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal Ian Rogers
@ 2026-08-28 22:36 ` sashiko-bot
2026-08-31 18:22 ` [PATCH v2 " Ian Rogers
2 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-08-28 22:36 UTC (permalink / raw)
To: Ian Rogers; +Cc: linux-perf-users
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Removal of `util/cache.h` removes implicit inclusions of standard POSIX headers, causing musl compatibility violations due to missing explicit includes.
--
commit 6e76c8b7f671374f4e87596d7f1af0426551795a
Author: Ian Rogers <irogers@google.com>
perf tool: Remove util/cache.h
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.
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -11,7 +11,6 @@
>
> #include "util/color.h"
> #include <linux/list.h>
> -#include "util/cache.h"
> #include <linux/rbtree.h>
> #include "util/symbol.h"
[Severity: Low]
Does the removal of util/cache.h drop implicit inclusions of standard POSIX
headers? This file uses standard string and allocation functions, so it
seems <string.h> and <stdlib.h> need to be explicitly included to avoid
build failures on systems using musl libc.
[ ... ]
> diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
> --- a/tools/perf/util/path.c
> +++ b/tools/perf/util/path.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
> #include "path.h"
> -#include "cache.h"
> #include <linux/kernel.h>
> #include <limits.h>
[Severity: Low]
With cache.h removed, does mkpath() now lack the required <stdarg.h> include?
Looking at mkpath() later in this file, it relies on va_start(args, fmt) which
requires <stdarg.h>. Without the explicit include, this causes musl
compatibility violations.
[ ... ]
> diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
> --- 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"
[Severity: Low]
Should <string.h> be explicitly included here? Looking at strbuf_add(), it
uses memcpy(), and relying on <linux/string.h> instead of the standard POSIX
header can cause namespace pollution and musl compilation failures.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828222045.1314766-1-irogers@google.com?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] perf tool: Remove util/cache.h
2026-08-28 22:20 [PATCH v1 1/2] perf tool: Remove util/cache.h Ian Rogers
2026-08-28 22:20 ` [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal Ian Rogers
2026-08-28 22:36 ` [PATCH v1 1/2] perf tool: Remove util/cache.h sashiko-bot
@ 2026-08-31 18:22 ` Ian Rogers
2026-08-31 18:22 ` [PATCH v2 2/2] perf tool: Tidy up util/cache.h header file users Ian Rogers
2026-08-31 20:30 ` [PATCH v2 1/2] perf tool: Remove util/cache.h sashiko-bot
2 siblings, 2 replies; 8+ messages in thread
From: Ian Rogers @ 2026-08-31 18:22 UTC (permalink / raw)
To: irogers, acme, namhyung
Cc: adrian.hunter, james.clark, jolsa, linux-kernel, linux-perf-users,
mingo, peterz, tmricht
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 <irogers@google.com>
---
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 <stdbool.h>
#include "util/color.h"
#include <linux/list.h>
-#include "util/cache.h"
#include <linux/rbtree.h>
#include "util/symbol.h"
@@ -38,12 +38,16 @@
#include "util/branch.h"
#include "util/util.h"
#include "ui/progress.h"
+#include "ui/ui.h"
#include <dlfcn.h>
#include <errno.h>
#include <linux/bitmap.h>
#include <linux/err.h>
#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
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"
-#include "util/cache.h"
#include <subcmd/parse-options.h>
#include "util/debug.h"
#include "util/config.h"
+#include "util/path.h"
#include <linux/string.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
static bool use_system_config, use_user_config;
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 <subcmd/exec-cmd.h>
@@ -21,6 +21,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
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"
#include "util/build-id.h"
-#include "util/cache.h"
#include "util/env.h"
#include <internal/lib.h> // page_size
#include <subcmd/exec-cmd.h>
#include "util/config.h"
#include <subcmd/run-command.h>
#include "util/parse-events.h"
+#include <subcmd/pager.h>
#include <subcmd/parse-options.h>
#include <subcmd/help.h>
#include "util/debug.h"
@@ -30,7 +30,10 @@
#include <errno.h>
#include <pthread.h>
#include <signal.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -39,6 +42,12 @@
#include <linux/string.h>
#include <linux/zalloc.h>
+#define CMD_EXEC_PATH "--exec-path"
+#define CMD_DEBUGFS_DIR "--debugfs-dir="
+
+#define EXEC_PATH_ENVIRONMENT "PERF_EXEC_PATH"
+#define PERF_PAGER_ENVIRONMENT "PERF_PAGER"
+
static int use_pager = -1;
static FILE *debug_fp = NULL;
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 <subcmd/pager.h>
-#include "../ui/ui.h"
-
-#include <linux/compiler.h>
-#include <linux/string.h>
-
-#define CMD_EXEC_PATH "--exec-path"
-#define CMD_DEBUGFS_DIR "--debugfs-dir="
-
-#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] == '/';
-}
-
-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 <errno.h>
#include <sys/param.h>
-#include "cache.h"
#include "callchain.h"
#include "header.h"
#include <subcmd/exec-cmd.h>
@@ -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 <sys/types.h>
#include <sys/stat.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
#include <unistd.h>
#include <linux/string.h>
#include <linux/zalloc.h>
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-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 <poll.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <subcmd/help.h>
#include "../builtin.h"
#include "levenshtein.h"
@@ -36,10 +36,14 @@ static int add_cmd_list(struct cmdnames *cmds, struct cmdnames *old)
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 = nr;
else
cmds->alloc = alloc_nr(cmds->alloc);
+
+#undef alloc_nr
tmp = 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 <linux/kernel.h>
#include <limits.h>
+#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
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 @@
#include <stddef.h>
#include <stdbool.h>
+#include <linux/compiler.h>
struct dirent;
+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 *path2, const char *path3);
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 <linux/kernel.h>
@@ -8,6 +7,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
/*
@@ -54,9 +54,12 @@ int strbuf_grow(struct strbuf *sb, size_t extra)
if (nr <= sb->len)
return -E2BIG;
+#define alloc_nr(x) (((x) + 16) * 3 / 2)
+
if (alloc_nr(sb->alloc) > nr)
nr = alloc_nr(sb->alloc);
+#undef alloc_nr
/*
* Note that sb->buf == strbuf_slopbuf if sb->alloc == 0, and it is
* a static variable. Thus we have to avoid passing it to realloc.
--
2.55.0.897.gb25b4bd76c-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] perf tool: Tidy up util/cache.h header file users
2026-08-31 18:22 ` [PATCH v2 " Ian Rogers
@ 2026-08-31 18:22 ` Ian Rogers
2026-08-31 20:56 ` sashiko-bot
2026-08-31 20:30 ` [PATCH v2 1/2] perf tool: Remove util/cache.h sashiko-bot
1 sibling, 1 reply; 8+ messages in thread
From: Ian Rogers @ 2026-08-31 18:22 UTC (permalink / raw)
To: irogers, acme, namhyung
Cc: adrian.hunter, james.clark, jolsa, linux-kernel, linux-perf-users,
mingo, peterz, tmricht
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 <irogers@google.com>
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 <errno.h>
+#include <inttypes.h>
#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-#include "util/color.h"
+#include <dlfcn.h>
+#include <linux/bitmap.h>
+#include <linux/err.h>
#include <linux/list.h>
#include <linux/rbtree.h>
-#include "util/symbol.h"
-#include "util/debug.h"
+#include <subcmd/parse-options.h>
-#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 <subcmd/parse-options.h>
-#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 <dlfcn.h>
-#include <errno.h>
-#include <linux/bitmap.h>
-#include <linux/err.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
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 <treeze.taeung@gmail.com>
*
*/
-#include "builtin.h"
-
-#include <subcmd/parse-options.h>
-#include "util/debug.h"
-#include "util/config.h"
-#include "util/path.h"
-#include <linux/string.h>
#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <string.h>
+#include <linux/string.h>
+
+#include <subcmd/parse-options.h>
+
+#include "builtin.h"
+#include "util/config.h"
+#include "util/debug.h"
+#include "util/path.h"
+
static bool use_system_config, use_user_config;
static const char * const config_usage[] = {
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 <subcmd/exec-cmd.h>
-#include <subcmd/parse-options.h>
-#include <subcmd/run-command.h>
-#include <subcmd/help.h>
-#include "util/debug.h"
-#include "util/util.h"
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/zalloc.h>
#include <errno.h>
#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <string.h>
-#include <sys/types.h>
+
+#include <linux/string.h>
+#include <linux/zalloc.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <subcmd/exec-cmd.h>
+#include <subcmd/help.h>
+#include <subcmd/parse-options.h>
+#include <subcmd/run-command.h>
+
+#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"
-#include "util/build-id.h"
-#include "util/env.h"
-#include <internal/lib.h> // page_size
-#include <subcmd/exec-cmd.h>
-#include "util/config.h"
-#include <subcmd/run-command.h>
-#include "util/parse-events.h"
-#include <subcmd/pager.h>
-#include <subcmd/parse-options.h>
-#include <subcmd/help.h>
-#include "util/debug.h"
-#include "util/event.h"
-#include "util/util.h" // usage()
-#include "ui/ui.h"
-#include "perf-sys.h"
-#include <api/fs/fs.h>
-#include <api/fs/tracing_path.h>
-#include <perf/core.h>
#include <errno.h>
-#include <pthread.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdbool.h>
#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <linux/kernel.h>
+
#include <linux/string.h>
#include <linux/zalloc.h>
+#include <sys/stat.h>
+
+#include <api/fs/tracing_path.h>
+#include <internal/lib.h> // page_size
+#include <perf/core.h>
+#include <subcmd/exec-cmd.h>
+#include <subcmd/help.h>
+#include <subcmd/pager.h>
+#include <subcmd/parse-options.h>
+#include <subcmd/run-command.h>
+
+#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()
#define CMD_EXEC_PATH "--exec-path"
#define CMD_DEBUGFS_DIR "--debugfs-dir="
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 <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <linux/ctype.h>
+#include <linux/string.h>
+#include <linux/zalloc.h>
#include <sys/param.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <subcmd/exec-cmd.h>
+
+#include "build-id.h"
#include "callchain.h"
+#include "debug.h"
#include "header.h"
-#include <subcmd/exec-cmd.h>
-#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 <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <string.h>
-#include <unistd.h>
-#include <linux/string.h>
-#include <linux/zalloc.h>
-#include <linux/ctype.h>
+#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 */
#define MAXNAME (256)
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-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 <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include <linux/zalloc.h>
+#include <poll.h>
+
#include <subcmd/help.h>
+
#include "../builtin.h"
+#include "config.h"
#include "levenshtein.h"
-#include <linux/zalloc.h>
static int autocorrect;
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 <linux/kernel.h>
+
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+
#include <dirent.h>
-#include <unistd.h>
+#include <linux/kernel.h>
+#include <sys/stat.h>
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
-#include <stddef.h>
#include <stdbool.h>
+#include <stddef.h>
+
#include <linux/compiler.h>
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 <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/zalloc.h>
+
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include <linux/zalloc.h>
#include <unistd.h>
+#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
--
2.55.0.897.gb25b4bd76c-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] perf tool: Remove util/cache.h
2026-08-31 18:22 ` [PATCH v2 " Ian Rogers
2026-08-31 18:22 ` [PATCH v2 2/2] perf tool: Tidy up util/cache.h header file users Ian Rogers
@ 2026-08-31 20:30 ` sashiko-bot
1 sibling, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-08-31 20:30 UTC (permalink / raw)
To: Ian Rogers; +Cc: linux-perf-users
> 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 <irogers@google.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260831182232.2959017-1-irogers@google.com?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] perf tool: Tidy up util/cache.h header file users
2026-08-31 18:22 ` [PATCH v2 2/2] perf tool: Tidy up util/cache.h header file users Ian Rogers
@ 2026-08-31 20:56 ` sashiko-bot
0 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-08-31 20:56 UTC (permalink / raw)
To: Ian Rogers; +Cc: linux-perf-users
> 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 <irogers@google.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260831182232.2959017-1-irogers@google.com?part=2
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-08-31 20:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 22:20 [PATCH v1 1/2] perf tool: Remove util/cache.h Ian Rogers
2026-08-28 22:20 ` [PATCH v1 2/2] perf tool: Sort headers from previous cache.h removal Ian Rogers
2026-08-28 22:27 ` sashiko-bot
2026-08-28 22:36 ` [PATCH v1 1/2] perf tool: Remove util/cache.h sashiko-bot
2026-08-31 18:22 ` [PATCH v2 " Ian Rogers
2026-08-31 18:22 ` [PATCH v2 2/2] perf tool: Tidy up util/cache.h header file users Ian Rogers
2026-08-31 20:56 ` sashiko-bot
2026-08-31 20:30 ` [PATCH v2 1/2] perf tool: Remove util/cache.h sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox