I am trying to use eBPF to trace functions defined in my own kernel modules, but get error.
libbpf: prog 'my_test_print': failed to find kernel BTF type ID of 'my_test_print': -3
libbpf: prog 'my_test_print': failed to prepare load attributes: -3
libbpf: prog 'my_test_print': failed to load: -3
libbpf: failed to load object 'ringbuffer_bpf'
libbpf: failed to load BPF skeleton 'ringbuffer_bpf': -3
I defined the function called my_test_print
and use
EXPORT_SYMBOL(my_test_print);
to expose the symbol. I also checked my kernel config:
CONFIG_DEBUG_INFO_BTF=y
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y
So is it possible to use eBPF to trace functions defined in my own kernel modules? How can I make it?
I find this has similar question, but no answer.
余亦欢 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.