On 3/29/20 5:48 PM, Liu Yiding wrote:
Add attachment.
Your BTF seems to be invalid. It has struct perf_ibs, which has a first
field `struct pmu pmu` field with valid-looking size of 296 bytes,
**but** the type that field points to is not a complete `struct pmu`
definition, but rather just forward declaration. The way it is it
shouldn't be even compilable, because forward declaration of a struct
doesn't specify the size of a struct, so compiler should have rejected
it. So it must be that either DWARF generated by compiler isn't correct,
or there is DWARF -> BTF conversion bug somewhere. Are you using any
special DWARF Kconfig settings? Maybe you can share your full .config
and I might try to repro it on my machine.
But either way, that warning you get is a valid one, it should be
illegal to have non-pointer forward-declared struct as a type for a
struct member.
On 3/30/20 8:46 AM, Liu Yiding wrote:
Something wrong with my smtp and this email missed.
Send again.
On 3/27/20 11:09 AM, Liu Yiding wrote:
Hi, Andrii.
Thanks for your prompt reply!
Please check attatchment for my_btf.bin.
On 3/27/20 4:28 AM, Andrii Nakryiko wrote:
Would you be able to share BTF of vmlinux that is used to generate
vmlinux.h? Please run in verbose mode: `make V=1` and search for
`bpftool btf dump file` command. It should point either to
/sys/kernel/btf/vmlinux or some other location, depending on how
things are set up on your side.
If it's /sys/kernel/btf/vmlinux, you can just `cat
/sys/kernel/btf/vmlinux > my_btf.bin`. If it's some other file,
easiest would be to just share that file. If not, it's possible to
extract .BTF ELF section, let me know if you need help with that.