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: 6910d7d386
("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
This commit is contained in:
Родитель
5b554ce518
Коммит
3e689141e6
|
@ -190,7 +190,7 @@ MENDIAN=$(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-mbig-endian)
|
||||||
CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG))
|
CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG))
|
||||||
BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \
|
BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \
|
||||||
-I$(OUTPUT) -I$(CURDIR) -I$(CURDIR)/include/uapi \
|
-I$(OUTPUT) -I$(CURDIR) -I$(CURDIR)/include/uapi \
|
||||||
-I$(APIDIR) -I$(BPFDIR) -I$(abspath $(OUTPUT)/../usr/include)
|
-I$(APIDIR) -I$(LIBDIR) -I$(BPFDIR) -I$(abspath $(OUTPUT)/../usr/include)
|
||||||
|
|
||||||
CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
|
CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
|
||||||
-Wno-compare-distinct-pointer-types
|
-Wno-compare-distinct-pointer-types
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
#include <bpf_core_read.h>
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
struct sock_common {
|
struct sock_common {
|
||||||
unsigned char skc_state;
|
unsigned char skc_state;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#ifndef __BPF_TRACE_HELPERS_H
|
#ifndef __BPF_TRACE_HELPERS_H
|
||||||
#define __BPF_TRACE_HELPERS_H
|
#define __BPF_TRACE_HELPERS_H
|
||||||
|
|
||||||
#include <bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#define ___bpf_concat(a, b) a ## b
|
#define ___bpf_concat(a, b) a ## b
|
||||||
#define ___bpf_apply(fn, n) ___bpf_concat(fn, n)
|
#define ___bpf_apply(fn, n) ___bpf_concat(fn, n)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libbpf.h> /* libbpf_num_possible_cpus */
|
#include <bpf/libbpf.h> /* libbpf_num_possible_cpus */
|
||||||
|
|
||||||
static inline unsigned int bpf_num_possible_cpus(void)
|
static inline unsigned int bpf_num_possible_cpus(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <test_progs.h>
|
#include <test_progs.h>
|
||||||
#include <bpf/btf.h>
|
#include <bpf/btf.h>
|
||||||
#include "libbpf_internal.h"
|
#include "bpf/libbpf_internal.h"
|
||||||
|
|
||||||
static int duration = 0;
|
static int duration = 0;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <test_progs.h>
|
#include <test_progs.h>
|
||||||
#include "libbpf_internal.h"
|
#include "bpf/libbpf_internal.h"
|
||||||
|
|
||||||
static void on_sample(void *ctx, int cpu, void *data, __u32 size)
|
static void on_sample(void *ctx, int cpu, void *data, __u32 size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
#include <bpf_trace_helpers.h>
|
#include "bpf_trace_helpers.h"
|
||||||
#include "bpf_tcp_helpers.h"
|
#include "bpf_tcp_helpers.h"
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <linux/if_tunnel.h>
|
#include <linux/if_tunnel.h>
|
||||||
#include <linux/mpls.h>
|
#include <linux/mpls.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
#define PROG(F) SEC(#F) int bpf_func_##F
|
#define PROG(F) SEC(#F) int bpf_func_##F
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
#include <linux/in6.h>
|
#include <linux/in6.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
#define SRC_REWRITE_IP4 0x7f000004U
|
#define SRC_REWRITE_IP4 0x7f000004U
|
||||||
#define DST_REWRITE_IP4 0x7f000001U
|
#define DST_REWRITE_IP4 0x7f000001U
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
#include <linux/in6.h>
|
#include <linux/in6.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
#define SRC_REWRITE_IP6_0 0
|
#define SRC_REWRITE_IP6_0 0
|
||||||
#define SRC_REWRITE_IP6_1 0
|
#define SRC_REWRITE_IP6_1 0
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
SEC("cgroup/dev")
|
SEC("cgroup/dev")
|
||||||
int bpf_prog1(struct bpf_cgroup_dev_ctx *ctx)
|
int bpf_prog1(struct bpf_cgroup_dev_ctx *ctx)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/* Copyright (c) 2019 Facebook */
|
/* Copyright (c) 2019 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/* Copyright (c) 2019 Facebook */
|
/* Copyright (c) 2019 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
struct sk_buff {
|
struct sk_buff {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/* Copyright (c) 2019 Facebook */
|
/* Copyright (c) 2019 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
struct sk_buff {
|
struct sk_buff {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/* Copyright (c) 2019 Facebook */
|
/* Copyright (c) 2019 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Copyright (c) 2018 Facebook
|
// Copyright (c) 2018 Facebook
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_ARRAY);
|
__uint(type, BPF_MAP_TYPE_ARRAY);
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Copyright (c) 2019 Facebook
|
// Copyright (c) 2019 Facebook
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_tracing.h"
|
#include <bpf/bpf_tracing.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_tracing.h"
|
#include <bpf/bpf_tracing.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_tracing.h"
|
#include <bpf/bpf_tracing.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2019 Facebook
|
// Copyright (c) 2019 Facebook
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2019 Facebook
|
// Copyright (c) 2019 Facebook
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "netcnt_common.h"
|
#include "netcnt_common.h"
|
||||||
|
|
||||||
#define MAX_BPS (3 * 1024 * 1024)
|
#define MAX_BPS (3 * 1024 * 1024)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#define FUNCTION_NAME_LEN 64
|
#define FUNCTION_NAME_LEN 64
|
||||||
#define FILE_NAME_LEN 128
|
#define FILE_NAME_LEN 128
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
|
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct bpf_map_def SEC("maps") htab = {
|
struct bpf_map_def SEC("maps") htab = {
|
||||||
.type = BPF_MAP_TYPE_HASH,
|
.type = BPF_MAP_TYPE_HASH,
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
#define SRC1_IP4 0xAC100001U /* 172.16.0.1 */
|
#define SRC1_IP4 0xAC100001U /* 172.16.0.1 */
|
||||||
#define SRC2_IP4 0x00000000U
|
#define SRC2_IP4 0x00000000U
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
#define SRC_REWRITE_IP6_0 0
|
#define SRC_REWRITE_IP6_0 0
|
||||||
#define SRC_REWRITE_IP6_1 0
|
#define SRC_REWRITE_IP6_1 0
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
struct socket_cookie {
|
struct socket_cookie {
|
||||||
__u64 cookie_key;
|
__u64 cookie_key;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
__u32 _version SEC("version") = 1;
|
__u32 _version SEC("version") = 1;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
__u32 _version SEC("version") = 1;
|
__u32 _version SEC("version") = 1;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
__u32 _version SEC("version") = 1;
|
__u32 _version SEC("version") = 1;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
typedef uint32_t pid_t;
|
typedef uint32_t pid_t;
|
||||||
struct task_struct {};
|
struct task_struct {};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
__u32 _version SEC("version") = 1;
|
__u32 _version SEC("version") = 1;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int kprobe_res = 0;
|
int kprobe_res = 0;
|
||||||
int kretprobe_res = 0;
|
int kretprobe_res = 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
/* Copyright (c) 2018 Facebook */
|
/* Copyright (c) 2018 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_legacy.h"
|
#include "bpf_legacy.h"
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
/* Copyright (c) 2018 Facebook */
|
/* Copyright (c) 2018 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_legacy.h"
|
#include "bpf_legacy.h"
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
/* Copyright (c) 2018 Facebook */
|
/* Copyright (c) 2018 Facebook */
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
/* non-existing BPF helper, to test dead code elimination */
|
/* non-existing BPF helper, to test dead code elimination */
|
||||||
static int (*bpf_missing_helper)(const void *arg1, int arg2) = (void *) 999;
|
static int (*bpf_missing_helper)(const void *arg1, int arg2) = (void *) 999;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_core_read.h"
|
#include <bpf/bpf_core_read.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
/* Permit pretty deep stack traces */
|
/* Permit pretty deep stack traces */
|
||||||
#define MAX_STACK_RAWTP 100
|
#define MAX_STACK_RAWTP 100
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_ARRAY);
|
__uint(type, BPF_MAP_TYPE_ARRAY);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/* Copyright (c) 2020 Facebook */
|
/* Copyright (c) 2020 Facebook */
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#ifndef MAX_STACK
|
#ifndef MAX_STACK
|
||||||
#define MAX_STACK (512 - 3 * 32 + 8)
|
#define MAX_STACK (512 - 3 * 32 + 8)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/* Copyright (c) 2020 Facebook */
|
/* Copyright (c) 2020 Facebook */
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
||||||
int f1(struct __sk_buff *skb)
|
int f1(struct __sk_buff *skb)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/* Copyright (c) 2020 Facebook */
|
/* Copyright (c) 2020 Facebook */
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
||||||
int f1(struct __sk_buff *skb)
|
int f1(struct __sk_buff *skb)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/* Copyright (c) 2020 Facebook */
|
/* Copyright (c) 2020 Facebook */
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
||||||
int f1(struct __sk_buff *skb)
|
int f1(struct __sk_buff *skb)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/* Copyright (c) 2020 Facebook */
|
/* Copyright (c) 2020 Facebook */
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
||||||
void foo(struct __sk_buff *skb)
|
void foo(struct __sk_buff *skb)
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
#include <linux/icmpv6.h>
|
#include <linux/icmpv6.h>
|
||||||
#include <linux/tcp.h>
|
#include <linux/tcp.h>
|
||||||
#include <linux/udp.h>
|
#include <linux/udp.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "test_iptunnel_common.h"
|
#include "test_iptunnel_common.h"
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
#include <linux/icmpv6.h>
|
#include <linux/icmpv6.h>
|
||||||
#include <linux/tcp.h>
|
#include <linux/tcp.h>
|
||||||
#include <linux/udp.h>
|
#include <linux/udp.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "test_iptunnel_common.h"
|
#include "test_iptunnel_common.h"
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/lirc.h>
|
#include <linux/lirc.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
SEC("lirc_mode2")
|
SEC("lirc_mode2")
|
||||||
int bpf_decoder(unsigned int *sample)
|
int bpf_decoder(unsigned int *sample)
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/ip.h>
|
#include <linux/ip.h>
|
||||||
#include <linux/ipv6.h>
|
#include <linux/ipv6.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
struct grehdr {
|
struct grehdr {
|
||||||
__be16 flags;
|
__be16 flags;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <linux/seg6_local.h>
|
#include <linux/seg6_local.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
/* Packet parsing state machine helpers. */
|
/* Packet parsing state machine helpers. */
|
||||||
#define cursor_advance(_cursor, _len) \
|
#define cursor_advance(_cursor, _len) \
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS);
|
__uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Copyright (c) 2019 Facebook
|
// Copyright (c) 2019 Facebook
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#define VAR_NUM 16
|
#define VAR_NUM 16
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
/* It is a dumb bpf program such that it must have no
|
/* It is a dumb bpf program such that it must have no
|
||||||
* issue to be loaded since testing the verifier is
|
* issue to be loaded since testing the verifier is
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_tracing.h"
|
#include <bpf/bpf_tracing.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
struct task_struct;
|
struct task_struct;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
#include <linux/in.h>
|
#include <linux/in.h>
|
||||||
#include <linux/tcp.h>
|
#include <linux/tcp.h>
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_tracing.h"
|
#include <bpf/bpf_tracing.h>
|
||||||
#include "bpf_trace_helpers.h"
|
#include "bpf_trace_helpers.h"
|
||||||
|
|
||||||
static struct sockaddr_in old;
|
static struct sockaddr_in old;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
#include <linux/ip.h>
|
#include <linux/ip.h>
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
static volatile const struct {
|
static volatile const struct {
|
||||||
unsigned a[4];
|
unsigned a[4];
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <linux/seg6_local.h>
|
#include <linux/seg6_local.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
/* Packet parsing state machine helpers. */
|
/* Packet parsing state machine helpers. */
|
||||||
#define cursor_advance(_cursor, _len) \
|
#define cursor_advance(_cursor, _len) \
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
|
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "test_select_reuseport_common.h"
|
#include "test_select_reuseport_common.h"
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Copyright (c) 2019 Facebook
|
// Copyright (c) 2019 Facebook
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
__u32 sig = 0, pid = 0, status = 0, signal_thread = 0;
|
__u32 sig = 0, pid = 0, status = 0, signal_thread = 0;
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include <linux/tcp.h>
|
#include <linux/tcp.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#define NUM_CGROUP_LEVELS 4
|
#define NUM_CGROUP_LEVELS 4
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
int _version SEC("version") = 1;
|
int _version SEC("version") = 1;
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct s {
|
struct s {
|
||||||
int a;
|
int a;
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
enum bpf_addr_array_idx {
|
enum bpf_addr_array_idx {
|
||||||
ADDR_SRV_IDX,
|
ADDR_SRV_IDX,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Copyright (c) 2019 Facebook
|
// Copyright (c) 2019 Facebook
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
struct hmap_elem {
|
struct hmap_elem {
|
||||||
volatile int cnt;
|
volatile int cnt;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Copyright (c) 2018 Facebook
|
// Copyright (c) 2018 Facebook
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#ifndef PERF_MAX_STACK_DEPTH
|
#ifndef PERF_MAX_STACK_DEPTH
|
||||||
#define PERF_MAX_STACK_DEPTH 127
|
#define PERF_MAX_STACK_DEPTH 127
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Copyright (c) 2018 Facebook
|
// Copyright (c) 2018 Facebook
|
||||||
|
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#ifndef PERF_MAX_STACK_DEPTH
|
#ifndef PERF_MAX_STACK_DEPTH
|
||||||
#define PERF_MAX_STACK_DEPTH 127
|
#define PERF_MAX_STACK_DEPTH 127
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <linux/stddef.h>
|
#include <linux/stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <linux/stddef.h>
|
#include <linux/stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <linux/stddef.h>
|
#include <linux/stddef.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
|
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
/* Max supported length of a string with unsigned long in base 10 (pow2 - 1). */
|
/* Max supported length of a string with unsigned long in base 10 (pow2 - 1). */
|
||||||
#define MAX_ULONG_STR_LEN 0xF
|
#define MAX_ULONG_STR_LEN 0xF
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
#include <linux/ip.h>
|
#include <linux/ip.h>
|
||||||
#include <linux/pkt_cls.h>
|
#include <linux/pkt_cls.h>
|
||||||
#include <linux/tcp.h>
|
#include <linux/tcp.h>
|
||||||
#include "bpf_helpers.h"
|
#include <bpf/bpf_helpers.h>
|
||||||
#include "bpf_endian.h"
|
#include <bpf/bpf_endian.h>
|
||||||
|
|
||||||
/* the maximum delay we are willing to add (drop packets beyond that) */
|
/* the maximum delay we are willing to add (drop packets beyond that) */
|
||||||
#define TIME_HORIZON_NS (2000 * 1000 * 1000)
|
#define TIME_HORIZON_NS (2000 * 1000 * 1000)
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче