Skip to content

cleanup the legacy probe_event on failed scenario

Chuang Wang bpf lkml netdev 3 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 0 repliesApplied 3/3
  2. v31 patch 4 repliesSuperseded
  3. v21 patch 4 repliesSuperseded

Changes in v4 from the cover letter

- cleanup the legacy kprobe_event on failed add/attach_event

Patches in v4 All 3 applied

#Subject and filesSizeRepliesApplied
1/3libbpf: cleanup the legacy kprobe_event on failed add/attach_event()tools/lib/bpf/libbpf.c+15 -40 repliesApplied
2/3libbpf: fix wrong variable used in perf_event_uprobe_open_legacy()tools/lib/bpf/libbpf.c+1 -10 repliesApplied
3/3libbpf: cleanup the legacy uprobe_event on failed add/attach_event()tools/lib/bpf/libbpf.c+15 -50 repliesApplied

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 0/3] cleanup the legacy probe_event on failed scenario

A potential scenario, when an error is returned after add_uprobe_event_legacy() in perf_event_uprobe_open_legacy(), or bpf_program__attach_perf_event_opts() in bpf_program__attach_uprobe_opts() returns an error, the uprobe_event that was previously created is not cleaned.

At the same time, the legacy kprobe_event also have similar problems.

With these patches, whenever an error is returned, it ensures that the created kprobe_event/uprobe_event is cleaned.

V1 -> v3:

- add detail commits
- call remove_kprobe_event_legacy() on failed bpf_program__attach_perf_event_opts()

v3 -> v4:

- cleanup the legacy kprobe_event on failed add/attach_event

Chuang Wang (3):
libbpf: cleanup the legacy kprobe_event on failed add/attach_event()
libbpf: fix wrong variable used in perf_event_uprobe_open_legacy()
libbpf: cleanup the legacy uprobe_event on failed add/attach_event()

 tools/lib/bpf/libbpf.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)
Signature · 1 line
2.34.1