[PATCH v3 01/16] perf trace: Include the headers declaring pid_t, strcmp and assert
From: Ian Rogers
Date: Fri Sep 18 2026 - 10:29:05 EST
trace_augment.h uses pid_t in the augmented_syscalls__set_filter_pids()
prototype and in the !HAVE_BPF_SKEL stub. bpf_trace_augment.c calls
strcmp() in augmented_syscalls__find_by_title() and assert() in
augmented_syscalls__create_bpf_output(), but neither pulls in the header
that declares what it uses. Both happen to build today only because
something else in the include chain drags <sys/types.h>, <string.h> and
<assert.h> in first, which is not guaranteed and does not hold on libcs
such as musl that keep the POSIX namespaces strictly separated.
Include <sys/types.h>, <string.h> and <assert.h> explicitly.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/util/bpf_trace_augment.c | 2 ++
tools/perf/util/trace_augment.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/tools/perf/util/bpf_trace_augment.c b/tools/perf/util/bpf_trace_augment.c
index a9cf2a77ded1..ebb26225fb04 100644
--- a/tools/perf/util/bpf_trace_augment.c
+++ b/tools/perf/util/bpf_trace_augment.c
@@ -1,5 +1,7 @@
+#include <assert.h>
#include <bpf/libbpf.h>
#include <internal/xyarray.h>
+#include <string.h>
#include "bpf_skel/augmented_raw_syscalls.skel.h"
#include "debug.h"
diff --git a/tools/perf/util/trace_augment.h b/tools/perf/util/trace_augment.h
index 4f729bc67753..a1cd9a5e0213 100644
--- a/tools/perf/util/trace_augment.h
+++ b/tools/perf/util/trace_augment.h
@@ -2,6 +2,7 @@
#define TRACE_AUGMENT_H
#include <linux/compiler.h>
+#include <sys/types.h>
struct bpf_program;
struct evlist;
--
2.55.0.1082.g2b9226bbc0-goog