Skip to content

Commit e626a13

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
selftests/bpf: drop unnecessary bpf_iter.h type duplication
Drop bpf_iter.h header which uses vmlinux.h but re-defines a bunch of iterator structures and some of BPF constants for use in BPF iterator selftests. None of that is necessary when fresh vmlinux.h header is generated for vmlinux image that matches latest selftests. So drop ugly hacks and have a nice plain vmlinux.h usage everywhere. We could do the same with all the kfunc __ksym redefinitions, but that has dependency on very fresh pahole, so I'm not addressing that here. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20241029203919.1948941-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 74975e1 commit e626a13

34 files changed

+33
-210
lines changed

tools/testing/selftests/bpf/progs/bpf_iter.h

Lines changed: 0 additions & 174 deletions
This file was deleted.

tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55
#include <bpf/bpf_tracing.h>
66

tools/testing/selftests/bpf/progs/bpf_iter_bpf_hash_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55

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

tools/testing/selftests/bpf/progs/bpf_iter_bpf_link.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2022 Red Hat, Inc. */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55

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

tools/testing/selftests/bpf/progs/bpf_iter_bpf_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55

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

tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55
#include <bpf/bpf_tracing.h>
66

tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_hash_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55
#include <bpf/bpf_tracing.h>
66

tools/testing/selftests/bpf/progs/bpf_iter_bpf_sk_storage_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Google LLC. */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include <bpf/bpf_helpers.h>
55
#include <bpf/bpf_tracing.h>
66

tools/testing/selftests/bpf/progs/bpf_iter_bpf_sk_storage_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include "bpf_tracing_net.h"
55
#include <bpf/bpf_helpers.h>
66
#include <bpf/bpf_tracing.h>

tools/testing/selftests/bpf/progs/bpf_iter_ipv6_route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2020 Facebook */
3-
#include "bpf_iter.h"
3+
#include <vmlinux.h>
44
#include "bpf_tracing_net.h"
55
#include <bpf/bpf_helpers.h>
66

0 commit comments

Comments
 (0)