Skip to content

Commit 3e68914

Browse files
tohojoAlexei Starovoitov
authored andcommitted
selftests: Use consistent include paths for libbpf
Fix all selftests to include libbpf header files with the bpf/ prefix, to be consistent with external users of the library. Also ensure that all includes of exported libbpf header files (those that are exported on 'make install' of the library) use bracketed includes instead of quoted. To not break the build, keep the old include path until everything has been changed to the new one; a subsequent patch will remove that. Fixes: 6910d7d ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir") Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/157952560568.1683545.9649335788846513446.stgit@toke.dk
1 parent 5b554ce commit 3e68914

128 files changed

Lines changed: 181 additions & 181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tools/testing/selftests/bpf/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ MENDIAN=$(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-mbig-endian)
190190
CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG))
191191
BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \
192192
-I$(OUTPUT) -I$(CURDIR) -I$(CURDIR)/include/uapi \
193-
-I$(APIDIR) -I$(BPFDIR) -I$(abspath $(OUTPUT)/../usr/include)
193+
-I$(APIDIR) -I$(LIBDIR) -I$(BPFDIR) -I$(abspath $(OUTPUT)/../usr/include)
194194

195195
CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
196196
-Wno-compare-distinct-pointer-types

‎tools/testing/selftests/bpf/bpf_tcp_helpers.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#include <stdbool.h>
66
#include <linux/types.h>
7-
#include <bpf_helpers.h>
8-
#include <bpf_core_read.h>
7+
#include <bpf/bpf_helpers.h>
8+
#include <bpf/bpf_core_read.h>
99

1010
struct sock_common {
1111
unsigned char skc_state;

‎tools/testing/selftests/bpf/bpf_trace_helpers.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef __BPF_TRACE_HELPERS_H
33
#define __BPF_TRACE_HELPERS_H
44

5-
#include <bpf_helpers.h>
5+
#include <bpf/bpf_helpers.h>
66

77
#define ___bpf_concat(a, b) a ## b
88
#define ___bpf_apply(fn, n) ___bpf_concat(fn, n)

‎tools/testing/selftests/bpf/bpf_util.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <stdlib.h>
77
#include <string.h>
88
#include <errno.h>
9-
#include <libbpf.h> /* libbpf_num_possible_cpus */
9+
#include <bpf/libbpf.h> /* libbpf_num_possible_cpus */
1010

1111
static inline unsigned int bpf_num_possible_cpus(void)
1212
{

‎tools/testing/selftests/bpf/prog_tests/cpu_mask.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <test_progs.h>
33
#include <bpf/btf.h>
4-
#include "libbpf_internal.h"
4+
#include "bpf/libbpf_internal.h"
55

66
static int duration = 0;
77

‎tools/testing/selftests/bpf/prog_tests/perf_buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <sched.h>
55
#include <sys/socket.h>
66
#include <test_progs.h>
7-
#include "libbpf_internal.h"
7+
#include "bpf/libbpf_internal.h"
88

99
static void on_sample(void *ctx, int cpu, void *data, __u32 size)
1010
{

‎tools/testing/selftests/bpf/progs/bpf_dctcp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include <linux/bpf.h>
1010
#include <linux/types.h>
11-
#include <bpf_helpers.h>
12-
#include <bpf_trace_helpers.h>
11+
#include <bpf/bpf_helpers.h>
12+
#include "bpf_trace_helpers.h"
1313
#include "bpf_tcp_helpers.h"
1414

1515
char _license[] SEC("license") = "GPL";

‎tools/testing/selftests/bpf/progs/bpf_flow.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <sys/socket.h>
1717
#include <linux/if_tunnel.h>
1818
#include <linux/mpls.h>
19-
#include "bpf_helpers.h"
20-
#include "bpf_endian.h"
19+
#include <bpf/bpf_helpers.h>
20+
#include <bpf/bpf_endian.h>
2121

2222
int _version SEC("version") = 1;
2323
#define PROG(F) SEC(#F) int bpf_func_##F

‎tools/testing/selftests/bpf/progs/connect4_prog.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <linux/in6.h>
1010
#include <sys/socket.h>
1111

12-
#include "bpf_helpers.h"
13-
#include "bpf_endian.h"
12+
#include <bpf/bpf_helpers.h>
13+
#include <bpf/bpf_endian.h>
1414

1515
#define SRC_REWRITE_IP4 0x7f000004U
1616
#define DST_REWRITE_IP4 0x7f000001U

‎tools/testing/selftests/bpf/progs/connect6_prog.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <linux/in6.h>
1010
#include <sys/socket.h>
1111

12-
#include "bpf_helpers.h"
13-
#include "bpf_endian.h"
12+
#include <bpf/bpf_helpers.h>
13+
#include <bpf/bpf_endian.h>
1414

1515
#define SRC_REWRITE_IP6_0 0
1616
#define SRC_REWRITE_IP6_1 0

0 commit comments

Comments
 (0)