revercc / libbpf-bootstrap-for-android

BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

BPF program load failed: Failed to open BPF skeleton #3

Open KevinChau9527 opened 3 months ago

KevinChau9527 commented 3 months ago

There is running log:

orangepi:/data # ./tc --help
libbpf: loading object 'tc_bpf' from buffer
libbpf: elf: section(2) .symtab, size 192, link 1, flags 0, type=2
libbpf: elf: section(3) tc, size 160, link 0, flags 6, type=1
libbpf: sec 'tc': found program 'tc_ingress' at insn offset 0 (0 bytes), code size 20 insns (160 bytes)
libbpf: elf: section(4) .rodata, size 36, link 0, flags 2, type=1
libbpf: elf: section(5) license, size 4, link 0, flags 3, type=1
libbpf: license of tc_bpf is GPL
libbpf: elf: section(6) .reltc, size 16, link 2, flags 40, type=9
libbpf: elf: section(7) .BTF, size 2124, link 0, flags 0, type=1
libbpf: elf: section(8) .BTF.ext, size 284, link 0, flags 0, type=1
libbpf: looking for externs among 8 symbols...
libbpf: collected 0 externs total
libbpf: map 'tc_bpf.rodata' (global data): at sec_idx 4, offset 0, flags 80.
libbpf: map 0 is "tc_bpf.rodata"
libbpf: sec '.reltc': collecting relocation for section(3) 'tc'
libbpf: sec '.reltc': relo #0: insn #14 against '.rodata'
libbpf: prog 'tc_ingress': found data map 0 (tc_bpf.rodata, sec 4, off 0) for insn 14
libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'tc_bpf'
libbpf: failed to load BPF skeleton 'tc_bpf': -3
Failed to open BPF skeleton

Is that mean I have to open some config and rebuild the kernel?

revercc commented 3 months ago

There is running log:

orangepi:/data # ./tc --help
libbpf: loading object 'tc_bpf' from buffer
libbpf: elf: section(2) .symtab, size 192, link 1, flags 0, type=2
libbpf: elf: section(3) tc, size 160, link 0, flags 6, type=1
libbpf: sec 'tc': found program 'tc_ingress' at insn offset 0 (0 bytes), code size 20 insns (160 bytes)
libbpf: elf: section(4) .rodata, size 36, link 0, flags 2, type=1
libbpf: elf: section(5) license, size 4, link 0, flags 3, type=1
libbpf: license of tc_bpf is GPL
libbpf: elf: section(6) .reltc, size 16, link 2, flags 40, type=9
libbpf: elf: section(7) .BTF, size 2124, link 0, flags 0, type=1
libbpf: elf: section(8) .BTF.ext, size 284, link 0, flags 0, type=1
libbpf: looking for externs among 8 symbols...
libbpf: collected 0 externs total
libbpf: map 'tc_bpf.rodata' (global data): at sec_idx 4, offset 0, flags 80.
libbpf: map 0 is "tc_bpf.rodata"
libbpf: sec '.reltc': collecting relocation for section(3) 'tc'
libbpf: sec '.reltc': relo #0: insn #14 against '.rodata'
libbpf: prog 'tc_ingress': found data map 0 (tc_bpf.rodata, sec 4, off 0) for insn 14
libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'tc_bpf'
libbpf: failed to load BPF skeleton 'tc_bpf': -3
Failed to open BPF skeleton

Is that mean I have to open some config and rebuild the kernel?

yes

KevinChau9527 commented 3 months ago

There is running log:

orangepi:/data # ./tc --help
libbpf: loading object 'tc_bpf' from buffer
libbpf: elf: section(2) .symtab, size 192, link 1, flags 0, type=2
libbpf: elf: section(3) tc, size 160, link 0, flags 6, type=1
libbpf: sec 'tc': found program 'tc_ingress' at insn offset 0 (0 bytes), code size 20 insns (160 bytes)
libbpf: elf: section(4) .rodata, size 36, link 0, flags 2, type=1
libbpf: elf: section(5) license, size 4, link 0, flags 3, type=1
libbpf: license of tc_bpf is GPL
libbpf: elf: section(6) .reltc, size 16, link 2, flags 40, type=9
libbpf: elf: section(7) .BTF, size 2124, link 0, flags 0, type=1
libbpf: elf: section(8) .BTF.ext, size 284, link 0, flags 0, type=1
libbpf: looking for externs among 8 symbols...
libbpf: collected 0 externs total
libbpf: map 'tc_bpf.rodata' (global data): at sec_idx 4, offset 0, flags 80.
libbpf: map 0 is "tc_bpf.rodata"
libbpf: sec '.reltc': collecting relocation for section(3) 'tc'
libbpf: sec '.reltc': relo #0: insn #14 against '.rodata'
libbpf: prog 'tc_ingress': found data map 0 (tc_bpf.rodata, sec 4, off 0) for insn 14
libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'tc_bpf'
libbpf: failed to load BPF skeleton 'tc_bpf': -3
Failed to open BPF skeleton

Is that mean I have to open some config and rebuild the kernel?

yes

Which kernel config should I change?

revercc commented 3 months ago

There is running log:

orangepi:/data # ./tc --help
libbpf: loading object 'tc_bpf' from buffer
libbpf: elf: section(2) .symtab, size 192, link 1, flags 0, type=2
libbpf: elf: section(3) tc, size 160, link 0, flags 6, type=1
libbpf: sec 'tc': found program 'tc_ingress' at insn offset 0 (0 bytes), code size 20 insns (160 bytes)
libbpf: elf: section(4) .rodata, size 36, link 0, flags 2, type=1
libbpf: elf: section(5) license, size 4, link 0, flags 3, type=1
libbpf: license of tc_bpf is GPL
libbpf: elf: section(6) .reltc, size 16, link 2, flags 40, type=9
libbpf: elf: section(7) .BTF, size 2124, link 0, flags 0, type=1
libbpf: elf: section(8) .BTF.ext, size 284, link 0, flags 0, type=1
libbpf: looking for externs among 8 symbols...
libbpf: collected 0 externs total
libbpf: map 'tc_bpf.rodata' (global data): at sec_idx 4, offset 0, flags 80.
libbpf: map 0 is "tc_bpf.rodata"
libbpf: sec '.reltc': collecting relocation for section(3) 'tc'
libbpf: sec '.reltc': relo #0: insn #14 against '.rodata'
libbpf: prog 'tc_ingress': found data map 0 (tc_bpf.rodata, sec 4, off 0) for insn 14
libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'tc_bpf'
libbpf: failed to load BPF skeleton 'tc_bpf': -3
Failed to open BPF skeleton

Is that mean I have to open some config and rebuild the kernel?

yes

Which kernel config should I change?

I use the linux 5.15 kernel directly, and this default configuration is enabled