mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-25 18:59:06 +08:00
Compare commits
9 Commits
v0.4.0_net
...
v0.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5579664205 | ||
|
|
860b201cd0 | ||
|
|
50e13993a1 | ||
|
|
72fd44da53 | ||
|
|
d6e9681b0d | ||
|
|
517762deca | ||
|
|
1670e6100b | ||
|
|
ed529685db | ||
|
|
c92a5d043e |
@@ -1 +1 @@
|
|||||||
d20b41115ad53293201cc07ee429a38740cb056b
|
47bb27a20d6ea22cd092c1fc2bb4fcecac374838
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ struct bpf_lpm_trie_key {
|
|||||||
|
|
||||||
struct bpf_cgroup_storage_key {
|
struct bpf_cgroup_storage_key {
|
||||||
__u64 cgroup_inode_id; /* cgroup inode id */
|
__u64 cgroup_inode_id; /* cgroup inode id */
|
||||||
__u32 attach_type; /* program attach type */
|
__u32 attach_type; /* program attach type (enum bpf_attach_type) */
|
||||||
};
|
};
|
||||||
|
|
||||||
union bpf_iter_link_info {
|
union bpf_iter_link_info {
|
||||||
@@ -4871,6 +4871,12 @@ union bpf_attr {
|
|||||||
* Return
|
* Return
|
||||||
* Value specified by user at BPF link creation/attachment time
|
* Value specified by user at BPF link creation/attachment time
|
||||||
* or 0, if it was not specified.
|
* or 0, if it was not specified.
|
||||||
|
*
|
||||||
|
* long bpf_task_pt_regs(struct task_struct *task)
|
||||||
|
* Description
|
||||||
|
* Get the struct pt_regs associated with **task**.
|
||||||
|
* Return
|
||||||
|
* A pointer to struct pt_regs.
|
||||||
*/
|
*/
|
||||||
#define __BPF_FUNC_MAPPER(FN) \
|
#define __BPF_FUNC_MAPPER(FN) \
|
||||||
FN(unspec), \
|
FN(unspec), \
|
||||||
@@ -5048,6 +5054,7 @@ union bpf_attr {
|
|||||||
FN(timer_cancel), \
|
FN(timer_cancel), \
|
||||||
FN(get_func_ip), \
|
FN(get_func_ip), \
|
||||||
FN(get_attach_cookie), \
|
FN(get_attach_cookie), \
|
||||||
|
FN(task_pt_regs), \
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
|
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
|
||||||
|
|||||||
@@ -4033,4 +4033,14 @@ static __u64 (*bpf_get_func_ip)(void *ctx) = (void *) 173;
|
|||||||
*/
|
*/
|
||||||
static __u64 (*bpf_get_attach_cookie)(void *ctx) = (void *) 174;
|
static __u64 (*bpf_get_attach_cookie)(void *ctx) = (void *) 174;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* bpf_task_pt_regs
|
||||||
|
*
|
||||||
|
* Get the struct pt_regs associated with **task**.
|
||||||
|
*
|
||||||
|
* Returns
|
||||||
|
* A pointer to struct pt_regs.
|
||||||
|
*/
|
||||||
|
static long (*bpf_task_pt_regs)(struct task_struct *task) = (void *) 175;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2993,6 +2993,12 @@ static int bpf_object__elf_collect(struct bpf_object *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!obj->efile.symbols) {
|
||||||
|
pr_warn("elf: couldn't find symbol table in %s, stripped object file?\n",
|
||||||
|
obj->path);
|
||||||
|
return -ENOENT;
|
||||||
|
}
|
||||||
|
|
||||||
scn = NULL;
|
scn = NULL;
|
||||||
while ((scn = elf_nextscn(elf, scn)) != NULL) {
|
while ((scn = elf_nextscn(elf, scn)) != NULL) {
|
||||||
idx++;
|
idx++;
|
||||||
|
|||||||
@@ -854,7 +854,7 @@ struct bpf_object_skeleton {
|
|||||||
size_t sz; /* size of this struct, for forward/backward compatibility */
|
size_t sz; /* size of this struct, for forward/backward compatibility */
|
||||||
|
|
||||||
const char *name;
|
const char *name;
|
||||||
void *data;
|
const void *data;
|
||||||
size_t data_sz;
|
size_t data_sz;
|
||||||
|
|
||||||
struct bpf_object **obj;
|
struct bpf_object **obj;
|
||||||
|
|||||||
@@ -90,17 +90,30 @@
|
|||||||
/* Symbol versioning is different between static and shared library.
|
/* Symbol versioning is different between static and shared library.
|
||||||
* Properly versioned symbols are needed for shared library, but
|
* Properly versioned symbols are needed for shared library, but
|
||||||
* only the symbol of the new version is needed for static library.
|
* only the symbol of the new version is needed for static library.
|
||||||
|
* Starting with GNU C 10, use symver attribute instead of .symver assembler
|
||||||
|
* directive, which works better with GCC LTO builds.
|
||||||
*/
|
*/
|
||||||
#ifdef SHARED
|
#if defined(SHARED) && defined(__GNUC__) && __GNUC__ >= 10
|
||||||
# define COMPAT_VERSION(internal_name, api_name, version) \
|
|
||||||
|
#define DEFAULT_VERSION(internal_name, api_name, version) \
|
||||||
|
__attribute__((symver(#api_name "@@" #version)))
|
||||||
|
#define COMPAT_VERSION(internal_name, api_name, version) \
|
||||||
|
__attribute__((symver(#api_name "@" #version)))
|
||||||
|
|
||||||
|
#elif defined(SHARED)
|
||||||
|
|
||||||
|
#define COMPAT_VERSION(internal_name, api_name, version) \
|
||||||
asm(".symver " #internal_name "," #api_name "@" #version);
|
asm(".symver " #internal_name "," #api_name "@" #version);
|
||||||
# define DEFAULT_VERSION(internal_name, api_name, version) \
|
#define DEFAULT_VERSION(internal_name, api_name, version) \
|
||||||
asm(".symver " #internal_name "," #api_name "@@" #version);
|
asm(".symver " #internal_name "," #api_name "@@" #version);
|
||||||
#else
|
|
||||||
# define COMPAT_VERSION(internal_name, api_name, version)
|
#else /* !SHARED */
|
||||||
# define DEFAULT_VERSION(internal_name, api_name, version) \
|
|
||||||
|
#define COMPAT_VERSION(internal_name, api_name, version)
|
||||||
|
#define DEFAULT_VERSION(internal_name, api_name, version) \
|
||||||
extern typeof(internal_name) api_name \
|
extern typeof(internal_name) api_name \
|
||||||
__attribute__((alias(#internal_name)));
|
__attribute__((alias(#internal_name)));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void libbpf_print(enum libbpf_print_level level,
|
extern void libbpf_print(enum libbpf_print_level level,
|
||||||
|
|||||||
@@ -281,6 +281,7 @@ out_mmap:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFAULT_VERSION(xsk_umem__create_v0_0_4, xsk_umem__create, LIBBPF_0.0.4)
|
||||||
int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area,
|
int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area,
|
||||||
__u64 size, struct xsk_ring_prod *fill,
|
__u64 size, struct xsk_ring_prod *fill,
|
||||||
struct xsk_ring_cons *comp,
|
struct xsk_ring_cons *comp,
|
||||||
@@ -345,6 +346,7 @@ struct xsk_umem_config_v1 {
|
|||||||
__u32 frame_headroom;
|
__u32 frame_headroom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
COMPAT_VERSION(xsk_umem__create_v0_0_2, xsk_umem__create, LIBBPF_0.0.2)
|
||||||
int xsk_umem__create_v0_0_2(struct xsk_umem **umem_ptr, void *umem_area,
|
int xsk_umem__create_v0_0_2(struct xsk_umem **umem_ptr, void *umem_area,
|
||||||
__u64 size, struct xsk_ring_prod *fill,
|
__u64 size, struct xsk_ring_prod *fill,
|
||||||
struct xsk_ring_cons *comp,
|
struct xsk_ring_cons *comp,
|
||||||
@@ -358,8 +360,6 @@ int xsk_umem__create_v0_0_2(struct xsk_umem **umem_ptr, void *umem_area,
|
|||||||
return xsk_umem__create_v0_0_4(umem_ptr, umem_area, size, fill, comp,
|
return xsk_umem__create_v0_0_4(umem_ptr, umem_area, size, fill, comp,
|
||||||
&config);
|
&config);
|
||||||
}
|
}
|
||||||
COMPAT_VERSION(xsk_umem__create_v0_0_2, xsk_umem__create, LIBBPF_0.0.2)
|
|
||||||
DEFAULT_VERSION(xsk_umem__create_v0_0_4, xsk_umem__create, LIBBPF_0.0.4)
|
|
||||||
|
|
||||||
static enum xsk_prog get_xsk_prog(void)
|
static enum xsk_prog get_xsk_prog(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ mmap # 5.5 kernel is too permissive with re-mmaping
|
|||||||
modify_return # fmod_ret support is missing
|
modify_return # fmod_ret support is missing
|
||||||
module_attach # module BTF support missing (v5.11+)
|
module_attach # module BTF support missing (v5.11+)
|
||||||
netcnt
|
netcnt
|
||||||
|
netns_cookie # v5.15+
|
||||||
ns_current_pid_tgid # bpf_get_ns_current_pid_tgid() helper is missing
|
ns_current_pid_tgid # bpf_get_ns_current_pid_tgid() helper is missing
|
||||||
pe_preserve_elems # v5.10+
|
pe_preserve_elems # v5.10+
|
||||||
perf_branches # bpf_read_branch_records() helper is missing
|
perf_branches # bpf_read_branch_records() helper is missing
|
||||||
@@ -74,10 +75,12 @@ socket_cookie # v5.12+
|
|||||||
sockmap_basic # uses new socket fields, 5.8+
|
sockmap_basic # uses new socket fields, 5.8+
|
||||||
sockmap_listen # no listen socket supportin SOCKMAP
|
sockmap_listen # no listen socket supportin SOCKMAP
|
||||||
sockopt_sk
|
sockopt_sk
|
||||||
|
sockopt_qos_to_cc # v5.15+
|
||||||
stacktrace_build_id # v5.9+
|
stacktrace_build_id # v5.9+
|
||||||
stack_var_off # v5.12+
|
stack_var_off # v5.12+
|
||||||
syscall # v5.14+
|
syscall # v5.14+
|
||||||
task_local_storage # v5.12+
|
task_local_storage # v5.12+
|
||||||
|
task_pt_regs # v5.15+
|
||||||
tcp_hdr_options # v5.10+, new TCP header options feature in BPF
|
tcp_hdr_options # v5.10+, new TCP header options feature in BPF
|
||||||
tcpbpf_user # LINK_CREATE is missing
|
tcpbpf_user # LINK_CREATE is missing
|
||||||
tc_redirect # v5.14+
|
tc_redirect # v5.14+
|
||||||
|
|||||||
@@ -459,10 +459,10 @@ if kvm-ok ; then
|
|||||||
else
|
else
|
||||||
accel="-cpu qemu64 -machine accel=tcg"
|
accel="-cpu qemu64 -machine accel=tcg"
|
||||||
fi
|
fi
|
||||||
qemu-system-x86_64 -nodefaults -display none -serial mon:stdio \
|
qemu-system-x86_64 -nodefaults -display none -serial mon:stdio -no-reboot \
|
||||||
${accel} -smp "$(nproc)" -m 4G \
|
${accel} -smp "$(nproc)" -m 4G \
|
||||||
-drive file="$IMG",format=raw,index=1,media=disk,if=virtio,cache=none \
|
-drive file="$IMG",format=raw,index=1,media=disk,if=virtio,cache=none \
|
||||||
-kernel "$vmlinuz" -append "root=/dev/vda rw console=ttyS0,115200$APPEND"
|
-kernel "$vmlinuz" -append "root=/dev/vda rw console=ttyS0,115200 kernel.panic=-1 $APPEND"
|
||||||
sudo mount -o loop "$IMG" "$mnt"
|
sudo mount -o loop "$IMG" "$mnt"
|
||||||
if exitstatus="$(cat "$mnt/exitstatus" 2>/dev/null)"; then
|
if exitstatus="$(cat "$mnt/exitstatus" 2>/dev/null)"; then
|
||||||
printf '\nTests exit status: %s\n' "$exitstatus" >&2
|
printf '\nTests exit status: %s\n' "$exitstatus" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user