diff options
author | Shreesh Adiga <16567adigashreesh@gmail.com> | 2022-12-18 20:09:27 +0530 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2023-03-10 17:26:47 +0800 |
commit | 197a137290103993b33f93c90e788ab4984f103a (patch) | |
tree | af5b73de58fd5b060766d0fee0b1b586f3595b03 /tools/ebpf/Makefile.ebpf | |
parent | 136e9dbad8b90c16ddfcb0bc986150f4b2a59eb2 (diff) | |
download | qemu-197a137290103993b33f93c90e788ab4984f103a.zip qemu-197a137290103993b33f93c90e788ab4984f103a.tar.gz qemu-197a137290103993b33f93c90e788ab4984f103a.tar.bz2 |
ebpf: fix compatibility with libbpf 1.0+
The current implementation fails to load on a system with
libbpf 1.0 and reports that legacy map definitions in 'maps'
section are not supported by libbpf v1.0+. This commit updates
the Makefile to add BTF (-g flag) and appropriately updates
the maps in rss.bpf.c and update the skeleton file in repo.
Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'tools/ebpf/Makefile.ebpf')
-rwxr-xr-x | tools/ebpf/Makefile.ebpf | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/ebpf/Makefile.ebpf b/tools/ebpf/Makefile.ebpf index 8f327ae..3391e7c 100755 --- a/tools/ebpf/Makefile.ebpf +++ b/tools/ebpf/Makefile.ebpf @@ -1,9 +1,9 @@ OBJS = rss.bpf.o -LLC ?= llc +LLVM_STRIP ?= llvm-strip CLANG ?= clang INC_FLAGS = `$(CLANG) -print-file-name=include` -EXTRA_CFLAGS ?= -O2 -emit-llvm -fno-stack-protector +EXTRA_CFLAGS ?= -O2 -g -target bpf all: $(OBJS) @@ -11,11 +11,13 @@ all: $(OBJS) clean: rm -f $(OBJS) + rm -f rss.bpf.skeleton.h $(OBJS): %.o:%.c $(CLANG) $(INC_FLAGS) \ -D__KERNEL__ -D__ASM_SYSREG_H \ -I../include $(LINUXINCLUDE) \ - $(EXTRA_CFLAGS) -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ + $(EXTRA_CFLAGS) -c $< -o $@ + $(LLVM_STRIP) -g $@ bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h cp rss.bpf.skeleton.h ../../ebpf/ |