[PATCH v1 02/11] perf bench messaging: Add missing includes and sort headers

From: Ian Rogers

Date: Thu Sep 17 2026 - 00:54:41 EST


Sashiko reported:

When building the perf tool on systems using musl libc, compilation
of tools/perf/bench/sched-messaging.c fails due to missing
signal-related header declarations.

The POSIX signal API and associated constants (SIGKILL, SIGINT,
SIGTERM) are referenced in sig_handler() and bench_sched_messaging()
but require an explicit inclusion of <signal.h>. While builds on
glibc succeed because the header is implicitly pulled in via other
includes, strict libc environments like musl do not provide this
implicit namespace pollution. This results in undeclared identifier
errors for kill() and signal() during the build process.

Add the header files and use git clang-format to sort.

Reported-by: sashiko-bot@xxxxxxxxxx
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/bench/sched-messaging.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 4fb6657fc826..5bdcc0595367 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -14,21 +14,23 @@
#include "bench.h"

/* Test groups of 20 processes spraying to 20 receivers */
-#include <pthread.h>
+#include <errno.h>
+#include <limits.h>
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <poll.h>
-#include <limits.h>
+
#include <err.h>
#include <linux/list.h>
#include <linux/time64.h>
+#include <poll.h>
+#include <pthread.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>

#define DATASIZE 100

--
2.55.0.1082.g2b9226bbc0-goog