mbox series

[RFC,bpf-next,0/8] bpf: Support ->show_fdinfo and ->fill_link_info for kprobe prog

Message ID 20230528142027.5585-1-laoar.shao@gmail.com (mailing list archive)
Headers show
Series bpf: Support ->show_fdinfo and ->fill_link_info for kprobe prog | expand

Message

Yafang Shao May 28, 2023, 2:20 p.m. UTC
Currently, it is not easy to determine which functions are probed by a
kprobe_multi program. This patchset supports ->show_fdinfo and
->fill_link_info for it, allowing the user to easily obtain the probed
functions.

Although the user can retrieve the functions probed by a perf_event
program using `bpftool perf show`, it would be beneficial to also support
->show_fdinfo and ->fill_link_info. This way, the user can obtain it in the
same manner as other bpf links.

It would be preferable to expose the address directly rather than the symbol
name, as multiple functions may share the same name.

Yafang Shao (8):
  bpf: Support ->show_fdinfo for kprobe_multi
  bpf: Support ->fill_link_info for kprobe_multi
  bpftool: Show probed function in kprobe_multi link info
  bpf: Always expose the probed address
  bpf: Support ->show_fdinfo for perf_event
  bpf: Add a common helper bpf_copy_to_user()
  bpf: Support ->fill_link_info for perf_event
  bpftool: Show probed function in perf_event link info

 include/uapi/linux/bpf.h       |  10 ++++
 kernel/bpf/syscall.c           | 107 +++++++++++++++++++++++++++++++++++------
 kernel/trace/bpf_trace.c       |  48 ++++++++++++++++++
 kernel/trace/trace_kprobe.c    |   2 +-
 tools/bpf/bpftool/link.c       |  71 ++++++++++++++++++++++++++-
 tools/include/uapi/linux/bpf.h |  10 ++++
 6 files changed, 232 insertions(+), 16 deletions(-)