Skip to content

Libbpf update #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion basic02-prog-by-name/xdp_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void list_avail_progs(struct bpf_object *obj)

bpf_object__for_each_program(pos, obj) {
if (bpf_program__is_xdp(pos))
printf(" %s\n", bpf_program__title(pos, false));
printf(" %s\n", bpf_program__section_name(pos));
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ LDFLAGS ?= -L$(LIBBPF_DIR)

BPF_CFLAGS ?= -I$(LIBBPF_DIR)/build/usr/include/ -I../headers/

LIBS = -l:libbpf.a -lelf $(USER_LIBS)
LIBS = -l:libbpf.a -lelf -lz $(USER_LIBS)

all: llvm-check $(USER_TARGETS) $(XDP_OBJ) $(COPY_LOADER) $(COPY_STATS)

Expand Down
2 changes: 1 addition & 1 deletion common/common_user_bpf_xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ struct bpf_object *load_bpf_and_xdp_attach(struct config *cfg)
exit(EXIT_FAIL_BPF);
}

strncpy(cfg->progsec, bpf_program__title(bpf_prog, false), sizeof(cfg->progsec));
strncpy(cfg->progsec, bpf_program__section_name(bpf_prog), sizeof(cfg->progsec));

prog_fd = bpf_program__fd(bpf_prog);
if (prog_fd <= 0) {
Expand Down
2 changes: 1 addition & 1 deletion libbpf
Submodule libbpf updated 59 files
+69 −90 .travis.yml
+1 −1 BPF-CHECKPOINT-COMMIT
+1 −1 CHECKPOINT-COMMIT
+1 −0 LICENSE
+32 −0 LICENSE.BSD-2-Clause
+503 −0 LICENSE.LPGL-2.1
+107 −17 README.md
+8 −0 include/linux/filter.h
+9 −0 include/linux/list.h
+1,355 −200 include/uapi/linux/bpf.h
+10 −3 include/uapi/linux/btf.h
+15 −1 include/uapi/linux/if_link.h
+4 −1 include/uapi/linux/if_xdp.h
+2 −1 scripts/check-reallocarray.sh
+47 −59 scripts/sync-kernel.sh
+17 −6 src/Makefile
+173 −7 src/bpf.c
+76 −7 src/bpf.h
+105 −23 src/bpf_core_read.h
+35 −8 src/bpf_endian.h
+839 −128 src/bpf_helper_defs.h
+36 −0 src/bpf_helpers.h
+241 −4 src/bpf_tracing.h
+327 −31 src/btf.c
+53 −53 src/btf.h
+126 −90 src/btf_dump.c
+14 −2 src/hashmap.c
+9 −7 src/hashmap.h
+5,733 −1,639 src/libbpf.c
+183 −53 src/libbpf.h
+104 −0 src/libbpf.map
+1 −1 src/libbpf.pc.template
+42 −0 src/libbpf_common.h
+3 −0 src/libbpf_errno.c
+116 −21 src/libbpf_internal.h
+36 −2 src/libbpf_probes.c
+44 −123 src/netlink.c
+3 −3 src/nlattr.c
+284 −0 src/ringbuf.c
+3 −0 src/str_error.c
+259 −130 src/xsk.c
+9 −0 src/xsk.h
+7 −3 travis-ci/managers/debian.sh
+2 −2 travis-ci/managers/ubuntu.sh
+30 −0 travis-ci/vmtest/build_pahole.sh
+41 −0 travis-ci/vmtest/build_selftests.sh
+44 −0 travis-ci/vmtest/checkout_latest_kernel.sh
+8 −0 travis-ci/vmtest/configs/INDEX
+72 −0 travis-ci/vmtest/configs/blacklist/BLACKLIST-5.5.0
+7 −0 travis-ci/vmtest/configs/blacklist/BLACKLIST-latest
+3,054 −0 travis-ci/vmtest/configs/latest.config
+7 −0 travis-ci/vmtest/configs/whitelist/WHITELIST-4.9.0
+12 −0 travis-ci/vmtest/helpers.sh
+148 −0 travis-ci/vmtest/mkrootfs.sh
+20 −0 travis-ci/vmtest/prepare_selftests.sh
+453 −0 travis-ci/vmtest/run.sh
+51 −0 travis-ci/vmtest/run_selftests.sh
+38 −0 travis-ci/vmtest/run_vmtest.sh
+82,043 −0 travis-ci/vmtest/vmlinux.h
6 changes: 3 additions & 3 deletions setup_dependencies.org
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ On a machine running the Fedora Linux distribution, install the packages:

#+begin_example
$ sudo dnf install clang llvm
$ sudo dnf install elfutils-libelf-devel libpcap-devel perf
$ sudo dnf install elfutils-libelf-devel libpcap-devel zlib-devel perf
#+end_example

Note also that Fedora by default sets a limit on the amount of locked memory
Expand All @@ -86,7 +86,7 @@ Note that you need to do this in the shell you are using to load programs
On Debian and Ubuntu installations, install the dependencies like this:

#+begin_example
$ sudo apt install clang llvm libelf-dev libpcap-dev gcc-multilib build-essential
$ sudo apt install clang llvm libelf-dev libpcap-dev zlib1g-dev gcc-multilib build-essential
#+end_example

To install the 'perf' utility, run this on Debian:
Expand All @@ -105,7 +105,7 @@ or this on Ubuntu:
On a machine running the openSUSE distribution, install the packages:

#+begin_example
$ sudo zypper install clang llvm libelf-devel libpcap-devel perf
$ sudo zypper install clang llvm libelf-devel libpcap-devel zlib-devel perf
#+end_example

* Kernel headers dependency
Expand Down
2 changes: 1 addition & 1 deletion tracing02-xdp-monitor/trace_load_and_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ static struct bpf_object* load_bpf_and_trace_attach(struct config *cfg)
}

bpf_object__for_each_program(prog, obj) {
const char *sec = bpf_program__title(prog, true);
const char *sec = bpf_program__section_name(prog);
char *tp;

if (!sec) {
Expand Down