diff --git a/samples/bpf/lwt_len_hist_kern.c b/samples/bpf/lwt_len_hist_kern.c index 44ea7b56760e287f15e47e34e0a42324da0329c0..dbab80e813fec58f5ce45948a5bac2e9e0cedf05 100644 --- a/samples/bpf/lwt_len_hist_kern.c +++ b/samples/bpf/lwt_len_hist_kern.c @@ -10,10 +10,7 @@ * General Public License for more details. */ -#include <uapi/linux/bpf.h> -#include <uapi/linux/if_ether.h> -#include <uapi/linux/ip.h> -#include <uapi/linux/in.h> +#include "vmlinux.h" #include <bpf/bpf_helpers.h> struct { diff --git a/samples/bpf/sock_flags_kern.c b/samples/bpf/sock_flags_kern.c index 84837ed48eb38c80da6a18fc5ec61045f6e59fab..0da749f6a9e10d50a8871bab9e5517c2d6e1f0c4 100644 --- a/samples/bpf/sock_flags_kern.c +++ b/samples/bpf/sock_flags_kern.c @@ -1,8 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "vmlinux.h" #include "net_shared.h" -#include <uapi/linux/bpf.h> -#include <linux/net.h> -#include <uapi/linux/in.h> -#include <uapi/linux/in6.h> #include <bpf/bpf_helpers.h> SEC("cgroup/sock") diff --git a/samples/bpf/test_cgrp2_tc_kern.c b/samples/bpf/test_cgrp2_tc_kern.c index 45a2f01d202933a567a99bae0a37ea4a042d619d..c7d2291d676f6882252c34ac47f30dedeb5dafbc 100644 --- a/samples/bpf/test_cgrp2_tc_kern.c +++ b/samples/bpf/test_cgrp2_tc_kern.c @@ -5,9 +5,8 @@ * License as published by the Free Software Foundation. */ #define KBUILD_MODNAME "foo" +#include "vmlinux.h" #include "net_shared.h" -#include <uapi/linux/ipv6.h> -#include <uapi/linux/bpf.h> #include <bpf/bpf_helpers.h> /* copy of 'struct ethhdr' without __packed */ diff --git a/samples/bpf/test_lwt_bpf.c b/samples/bpf/test_lwt_bpf.c index fc093fbc760a7cabcae34db183ce804c8e477e2e..9a13dbb81847ab8b83f4ee0796350aeae9a1fdf1 100644 --- a/samples/bpf/test_lwt_bpf.c +++ b/samples/bpf/test_lwt_bpf.c @@ -10,17 +10,8 @@ * General Public License for more details. */ +#include "vmlinux.h" #include "net_shared.h" -#include <stdint.h> -#include <stddef.h> -#include <linux/bpf.h> -#include <linux/ip.h> -#include <linux/in.h> -#include <linux/in6.h> -#include <linux/tcp.h> -#include <linux/udp.h> -#include <linux/icmpv6.h> -#include <linux/if_ether.h> #include <bpf/bpf_helpers.h> #include <string.h> diff --git a/samples/bpf/test_map_in_map_kern.c b/samples/bpf/test_map_in_map_kern.c index 0e17f9ade5c5699d7765307a835f0c124ca3090a..1883559e5977251cf1ebe686a4bf634d1760af06 100644 --- a/samples/bpf/test_map_in_map_kern.c +++ b/samples/bpf/test_map_in_map_kern.c @@ -6,16 +6,17 @@ * License as published by the Free Software Foundation. */ #define KBUILD_MODNAME "foo" -#include <linux/ptrace.h> +#include "vmlinux.h" #include <linux/version.h> -#include <uapi/linux/bpf.h> -#include <uapi/linux/in6.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h> #include <bpf/bpf_core_read.h> #define MAX_NR_PORTS 65536 +#define EINVAL 22 +#define ENOENT 2 + /* map #0 */ struct inner_a { __uint(type, BPF_MAP_TYPE_ARRAY); diff --git a/samples/bpf/test_overhead_kprobe_kern.c b/samples/bpf/test_overhead_kprobe_kern.c index ba82949338c272f7dc56661600ae2927883e23d2..c3528731e0e1c005a35529fd73f1c7f3f793bb7f 100644 --- a/samples/bpf/test_overhead_kprobe_kern.c +++ b/samples/bpf/test_overhead_kprobe_kern.c @@ -4,10 +4,8 @@ * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ +#include "vmlinux.h" #include <linux/version.h> -#include <linux/ptrace.h> -#include <linux/sched.h> -#include <uapi/linux/bpf.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h> diff --git a/samples/bpf/test_overhead_raw_tp_kern.c b/samples/bpf/test_overhead_raw_tp_kern.c index 3e29de0eca98d526df39a40d31d8c5b76e7e0173..6af39fe3f8dd03013f2a3154038f4ed6ff8b4d05 100644 --- a/samples/bpf/test_overhead_raw_tp_kern.c +++ b/samples/bpf/test_overhead_raw_tp_kern.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2018 Facebook */ -#include <uapi/linux/bpf.h> +#include "vmlinux.h" #include <bpf/bpf_helpers.h> SEC("raw_tracepoint/task_rename") diff --git a/samples/bpf/test_overhead_tp_kern.c b/samples/bpf/test_overhead_tp_kern.c index f170e9b1ea214ffba6f416f88314e83158cafcbf..67cab38819698bc370db04ee299d8060611635b5 100644 --- a/samples/bpf/test_overhead_tp_kern.c +++ b/samples/bpf/test_overhead_tp_kern.c @@ -4,8 +4,7 @@ * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ -#include <linux/sched.h> -#include <uapi/linux/bpf.h> +#include "vmlinux.h" #include <bpf/bpf_helpers.h> /* from /sys/kernel/debug/tracing/events/task/task_rename/format */