Skip to content

Commit

Permalink
Sync libbpf (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Dec 22, 2022
1 parent aaa6355 commit 84e70d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ LINUXINCLUDE += -include $(KERNELSOURCE)/include/linux/kconfig.h
LINUXINCLUDE += -I../includes

CLANG_VERSION := $(shell clang --version | grep -o -E 'clang version [0-9]+\.[0-9]+\.[0-9]' | cut -f 3 -d ' ')
CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -d. -f1 )
LLVM_INCLUDES = $(shell [ -d /usr/lib/clang ] && echo "-I/usr/lib/clang/$(CLANG_VERSION)/include" || echo "-I/usr/lib64/clang/$(CLANG_VERSION)/include")
LLVM_INCLUDES += -I/opt/rh/llvm-toolset-7.0/root/usr/lib64/clang/$(CLANG_VERSION)/include

Expand Down Expand Up @@ -86,13 +87,19 @@ else
NETDATA_APPS= ${NETDATA_ALL_APPS}
endif

ifeq ($(shell test $(CLANG_MAJOR_VERSION) -ge 8 ; echo $$?),0)
CC_LIBBPF = clang
else
CC_LIBBPF = gcc
endif

all: $(NETDATA_APPS)

dev: ${NETDATA_ALL_APPS}

libbpf:
# -fPIE added to be compatible with olders clang/gcc
cd $(LIBBPF)/src && /bin/bash ../../.dockerfiles/change_libbpf.sh $(VER_MAJOR) $(VER_MINOR) && $(MAKE) CC=clang CFLAGS="-fPIE" BUILD_STATIC_ONLY=1 DESTDIR=../../.local_libbpf INCLUDEDIR= LIBDIR= UAPIDIR= install \
cd $(LIBBPF)/src && /bin/bash ../../.dockerfiles/change_libbpf.sh $(VER_MAJOR) $(VER_MINOR) && $(MAKE) CC=$(CC_LIBBPF) CFLAGS="-fPIE" BUILD_STATIC_ONLY=1 DESTDIR=../../.local_libbpf INCLUDEDIR= LIBDIR= UAPIDIR= install \

%_kern.o: %_kern.c libbpf
if [ -w $(KERNELSOURCE)/include/generated/autoconf.h ]; then if [ "$(CURRENT_KERNEL)" -ge 328448 ]; then sed -i -e 's/\(#define CONFIG_CC_HAS_ASM_INLINE 1\)/\/\/\1/' $(KERNELSOURCE)/include/generated/autoconf.h; fi ; fi
Expand Down
2 changes: 1 addition & 1 deletion libbpf
Submodule libbpf updated 53 files
+2 −0 .github/actions/build-selftests/helpers.sh
+78,027 −73,682 .github/actions/build-selftests/vmlinux.h
+2 −2 .github/actions/setup/action.yml
+4 −1 .github/actions/vmtest/action.yml
+14 −4 .github/workflows/build.yml
+52 −0 .github/workflows/codeql.yml
+19 −0 .github/workflows/lint.yml
+1 −1 .github/workflows/pahole.yml
+4 −4 .github/workflows/test.yml
+0 −14 .lgtm.yml
+1 −1 BPF-CHECKPOINT-COMMIT
+1 −1 CHECKPOINT-COMMIT
+3 −2 README.md
+0 −0 ci/diffs/.keep
+0 −35 ci/diffs/001-fix-oob-write-in-test_verifier.diff
+16 −11 ci/managers/debian.sh
+0 −107 ci/rootfs/mkrootfs_arch.sh
+0 −52 ci/rootfs/mkrootfs_debian.sh
+0 −61 ci/rootfs/mkrootfs_tweak.sh
+0 −108 ci/rootfs/s390x-self-hosted-builder/README.md
+0 −52 ci/rootfs/s390x-self-hosted-builder/actions-runner-libbpf.Dockerfile
+0 −24 ci/rootfs/s390x-self-hosted-builder/actions-runner-libbpf.service
+0 −41 ci/rootfs/s390x-self-hosted-builder/fs/usr/bin/actions-runner
+0 −35 ci/rootfs/s390x-self-hosted-builder/fs/usr/bin/entrypoint
+0 −11 ci/rootfs/s390x-self-hosted-builder/qemu-user-static.service
+0 −3 ci/vmtest/configs/DENYLIST-latest.s390x
+2 −0 ci/vmtest/helpers.sh
+1 −1 ci/vmtest/run_selftests.sh
+3 −0 docs/index.rst
+203 −0 docs/program_types.rst
+310 −228 include/uapi/linux/bpf.h
+114 −0 include/uapi/linux/fcntl.h
+1 −0 include/uapi/linux/if_link.h
+52 −5 include/uapi/linux/perf_event.h
+1 −1 scripts/build-fuzzers.sh
+12 −9 scripts/sync-kernel.sh
+2 −1 src/Makefile
+44 −4 src/bpf.c
+23 −0 src/bpf.h
+67 −14 src/bpf_helper_defs.h
+206 −80 src/btf.c
+183 −60 src/btf_dump.c
+9 −9 src/hashmap.c
+57 −34 src/hashmap.h
+168 −102 src/libbpf.c
+5 −1 src/libbpf.map
+12 −4 src/libbpf_errno.c
+2 −1 src/libbpf_probes.c
+1 −1 src/nlattr.c
+22 −8 src/ringbuf.c
+9 −9 src/strset.c
+30 −33 src/usdt.c
+0 −1 travis-ci

0 comments on commit 84e70d0

Please sign in to comment.