Skip to content

samples: bpf: refactor kprobe tracing progs with libbpf

Daniel T. Lee bpf netdev 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesApplied
  2. v13 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- refactor pointer error check with libbpf_get_error
- on bpf object open failure, return instead jump to cleanup
- add macro for adding architecture prefix to system calls (sys_*)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5samples: bpf: refactor pointer error check with libbpfsamples/bpf/sampleip_user.c samples/bpf/trace_event_user.c samples/bpf/xdp_redirect_cpu_user.c+6 -150 replies
2/5samples: bpf: refactor kprobe tracing user progs with libbpfsamples/bpf/Makefile samples/bpf/trace_common.h samples/bpf/tracex1_user.c +6 more+252 -640 replies
3/5samples: bpf: refactor tail call user progs with libbpfsamples/bpf/Makefile samples/bpf/sockex3_user.c samples/bpf/tracex5_user.c+103 -310 replies
4/5samples: bpf: add tracex7 test file to .gitignoresamples/bpf/.gitignore+1 -00 replies
5/5samples: bpf: refactor kprobe, tail call kern progs map definitionsamples/bpf/sampleip_kern.c samples/bpf/sockex3_kern.c samples/bpf/trace_event_kern.c +5 more+93 -910 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchYonghong Song
SeriesA-b
1/5
2/5
3/5
4/5
5/5

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 bpf-next v2 0/5] samples: bpf: refactor kprobe tracing progs with libbpf

Currently, the kprobe BPF program attachment method for bpf_load is pretty outdated. The implementation of bpf_load "directly" controls and manages(create, delete) the kprobe events of DEBUGFS. On the other hand, using using the libbpf automatically manages the kprobe event. (under bpf_link interface)

This patchset refactors kprobe tracing programs with using libbpf API for loading bpf program instead of previous bpf_load implementation.

---
Changes in V2:
- refactor pointer error check with libbpf_get_error
- on bpf object open failure, return instead jump to cleanup
- add macro for adding architecture prefix to system calls (sys_*)

Daniel T. Lee (5):
samples: bpf: refactor pointer error check with libbpf
samples: bpf: refactor kprobe tracing user progs with libbpf
samples: bpf: refactor tail call user progs with libbpf
samples: bpf: add tracex7 test file to .gitignore
samples: bpf: refactor kprobe, tail call kern progs map definition

 samples/bpf/.gitignore              |  1 +
 samples/bpf/Makefile                | 16 +++----
 samples/bpf/sampleip_kern.c         | 12 +++---
 samples/bpf/sampleip_user.c         |  7 +--
 samples/bpf/sockex3_kern.c          | 36 ++++++++--------
 samples/bpf/sockex3_user.c          | 64 +++++++++++++++++++---------
 samples/bpf/trace_common.h          | 13 ++++++
 samples/bpf/trace_event_kern.c      | 24 +++++------
 samples/bpf/trace_event_user.c      |  9 ++--
 samples/bpf/tracex1_user.c          | 37 +++++++++++++---
 samples/bpf/tracex2_kern.c          | 27 ++++++------
 samples/bpf/tracex2_user.c          | 51 ++++++++++++++++++----
 samples/bpf/tracex3_kern.c          | 24 +++++------
 samples/bpf/tracex3_user.c          | 61 +++++++++++++++++++-------
 samples/bpf/tracex4_kern.c          | 12 +++---
 samples/bpf/tracex4_user.c          | 51 +++++++++++++++++-----
 samples/bpf/tracex5_kern.c          | 14 +++---
 samples/bpf/tracex5_user.c          | 66 +++++++++++++++++++++++++----
 samples/bpf/tracex6_kern.c          | 38 +++++++++--------
 samples/bpf/tracex6_user.c          | 49 ++++++++++++++++++---
 samples/bpf/tracex7_user.c          | 39 +++++++++++++----
 samples/bpf/xdp_redirect_cpu_user.c |  5 +--
 22 files changed, 455 insertions(+), 201 deletions(-)
 create mode 100644 samples/bpf/trace_common.h
Signature · 1 line
2.25.1