Skip to content

bpf: cleanup BTF-enabled raw_tp

Alexei Starovoitov bpf netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: replace prog_raw_tp+btf_id with prog_tracinginclude/linux/bpf.h include/linux/bpf_types.h include/uapi/linux/bpf.h +3 more+71 -214 replies
2/2libbpf: add support for prog_tracingtools/include/uapi/linux/bpf.h tools/lib/bpf/bpf.c tools/lib/bpf/bpf.h +4 more+71 -281 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndrii NakryikoMartin KaFai Lau
1/2A-b A-b
2/2A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/2] bpf: cleanup BTF-enabled raw_tp

v1->v2: addressed Andrii's feedback

When BTF-enabled raw_tp were introduced the plan was to follow up with BTF-enabled kprobe and kretprobe reusing PROG_RAW_TRACEPOINT and PROG_KPROBE types. But k[ret]probe expect pt_regs while BTF-enabled program ctx will be the same as raw_tp. kretprobe is indistinguishable from kprobe while BTF-enabled kretprobe will have access to retval while kprobe will not. Hence PROG_KPROBE type is not reusable and reusing PROG_RAW_TRACEPOINT no longer fits well.
Hence introduce 'umbrella' prog type BPF_PROG_TYPE_TRACING that will cover different BTF-enabled tracing attach points. The changes make libbpf side cleaner as well. check_attach_btf_id() is cleaner too.

Alexei Starovoitov (2):
bpf: replace prog_raw_tp+btf_id with prog_tracing
libbpf: add support for prog_tracing

 include/linux/bpf.h            |  5 +++
 include/linux/bpf_types.h      |  1 +
 include/uapi/linux/bpf.h       |  2 +
 kernel/bpf/syscall.c           |  6 +--
 kernel/bpf/verifier.c          | 34 ++++++++++-----
 kernel/trace/bpf_trace.c       | 44 +++++++++++++++----
 tools/include/uapi/linux/bpf.h |  2 +
 tools/lib/bpf/bpf.c            |  8 ++--
 tools/lib/bpf/bpf.h            |  5 ++-
 tools/lib/bpf/libbpf.c         | 79 ++++++++++++++++++++++++----------
 tools/lib/bpf/libbpf.h         |  2 +
 tools/lib/bpf/libbpf.map       |  2 +
 tools/lib/bpf/libbpf_probes.c  |  1 +
 13 files changed, 142 insertions(+), 49 deletions(-)
Signature · 1 line
2.17.1