Custom 'hello' BPF CO-RE example failed on Debian 10 again for some reason

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
This (https://github.com/sartura/ebpf-core-sample) is the code I'm using.
But I add " #define BPF_NO_GLOBAL_DATA 1 " on 'hello.bpf.c' so that
Debian 10 is able to execute it.
Compiled on default Debian11 amd64 environment with clang package
installed from mirror source.
Both 'hello' and 'maps' used to work on Debian10 about a month ago.
But 'hello' now can't. I'd like to improve this result.
-----------------------------------------------------------------------------------------
This is how I compiled them in steps:

# bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
# clang -g -O2 -target bpf -D__TARGET_ARCH_x86_64 -I . -c hello.bpf.c -o
# hello.bpf.o
# bpftool gen skeleton hello.bpf.o > hello.skel.h
# clang -g -O2 -Wall -I . -c hello.c -o hello.o
# git clone https://github.com/libbpf/libbpf
# cd libbpf/src
# make BUILD_STATIC_ONLY=1 OBJDIR=../build/libbpf DESTDIR=../build
INCLUDEDIR= LIBDIR= UAPIDIR= install
# cd ../../
# clang -Wall -O2 -g hello.o libbpf/build/libbpf.a -lelf -lz -o hello

There was only one warning message: "libbpf: elf: skipping
unrecognized data section(4) .rodata.str1.1", which appeared during
the generation of 'hello.skel.h'. There are no other warning and error
messages during this whole 'hello' and 'maps' compilation.
-------------------------------------------------------------------------------------------------------------------
Result of executing 'hello' on default amd64 Debian10 environment:

libbpf: kernel doesn't support global data
libbpf: failed to load object 'hello_bpf'
libbpf: failed to load BPF skeleton 'hello_bpf': -95
failed to load BPF object -95
-------------------------------------------------------------------------------------------------------------------
>From what I can remember, That warning message used to appear even
when I'm executing 'hello' on Debian10. But the BPF program work just
fine then. Maybe there is something else I can do?

Sincerely,
Poony.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux