Skip to content

RFC fentry supports function optimized by complier

Tao Chen bpf lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libbpf: Try get fentry func addr from available_filter_functions_addrtools/include/uapi/linux/bpf.h tools/lib/bpf/bpf.c tools/lib/bpf/bpf.h +2 more+57 -00 replies
2/2bpf: Get fentry func addr from user when BTF info invalidinclude/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/syscall.c +1 more+12 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH bpf-next 0/2] fentry supports function optimized by complier

The previous discussion about fentry invalid on function optimeized by complier is as follows:
https://lore.kernel.org/bpf/[email protected]/

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(+)
Signature · 1 line
2.43.0