mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-16 11:26:09 +07:00
3e689141e6
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
47 lines
797 B
C
47 lines
797 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2019 Facebook */
|
|
|
|
#include <stdbool.h>
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
struct s {
|
|
int a;
|
|
long long b;
|
|
} __attribute__((packed));
|
|
|
|
int in1 = 0;
|
|
long long in2 = 0;
|
|
char in3 = '\0';
|
|
long long in4 __attribute__((aligned(64))) = 0;
|
|
struct s in5 = {};
|
|
|
|
long long out2 = 0;
|
|
char out3 = 0;
|
|
long long out4 = 0;
|
|
int out1 = 0;
|
|
|
|
extern bool CONFIG_BPF_SYSCALL __kconfig;
|
|
extern int LINUX_KERNEL_VERSION __kconfig;
|
|
bool bpf_syscall = 0;
|
|
int kern_ver = 0;
|
|
|
|
SEC("raw_tp/sys_enter")
|
|
int handler(const void *ctx)
|
|
{
|
|
static volatile struct s out5;
|
|
|
|
out1 = in1;
|
|
out2 = in2;
|
|
out3 = in3;
|
|
out4 = in4;
|
|
out5 = in5;
|
|
|
|
bpf_syscall = CONFIG_BPF_SYSCALL;
|
|
kern_ver = LINUX_KERNEL_VERSION;
|
|
|
|
return 0;
|
|
}
|
|
|
|
char _license[] SEC("license") = "GPL";
|