The previous discussion about fentry invalid on function optimeized by complier is as follows: https://lore.kernel.org/bpf/3c6f539b-b498-4587-b0dc-5fdeba717600@xxxxxxxxxx/ This seems to be something that pahole needs to resolve. However, Alan mentioned that there are many situations involved in this, and he proposed that the available_filter_functions_addr can be used to find the address of the real function. If we can get the real address from user, maybe this address can be used when the function obtained from the BTF is invalid. The specific selftest has not been added yet. I just wrote a simple test program and ran it. This is the initial RFC patch, feedback is welcome. Tao Chen (2): libbpf: Try get fentry func addr from available_filter_functions_addr bpf: Get fentry func addr from user when BTF info invalid include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 1 + kernel/bpf/syscall.c | 1 + kernel/bpf/verifier.c | 9 ++++++ tools/include/uapi/linux/bpf.h | 1 + tools/lib/bpf/bpf.c | 1 + tools/lib/bpf/bpf.h | 1 + tools/lib/bpf/gen_loader.c | 1 + tools/lib/bpf/libbpf.c | 53 ++++++++++++++++++++++++++++++++++ 9 files changed, 69 insertions(+) -- 2.43.0