summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/veristat.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-04-01 01:24:04 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-04-01 19:05:57 +0300
commite3b65c0c1a5b8ed06818b7eeb0c44165ea817d52 (patch)
tree382f49a3d48a7929627a6c7e089063a47f5c6102 /tools/testing/selftests/bpf/veristat.c
parent71c8c39f517787af19d9f35fe60463f7eec914e1 (diff)
downloadlinux-e3b65c0c1a5b8ed06818b7eeb0c44165ea817d52.tar.xz
veristat: avoid using kernel-internal headers
Drop linux/compiler.h include, which seems to be needed for ARRAY_SIZE macro only. Redefine own version of ARRAY_SIZE instead. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20230331222405.3468634-4-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/veristat.c')
-rw-r--r--tools/testing/selftests/bpf/veristat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
index daac72b76508..e592d05bccb2 100644
--- a/tools/testing/selftests/bpf/veristat.c
+++ b/tools/testing/selftests/bpf/veristat.c
@@ -4,7 +4,6 @@
#include <argp.h>
#include <string.h>
#include <stdlib.h>
-#include <linux/compiler.h>
#include <sched.h>
#include <pthread.h>
#include <dirent.h>
@@ -20,6 +19,10 @@
#include <gelf.h>
#include <float.h>
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#endif
+
enum stat_id {
VERDICT,
DURATION,