Skip to content

Reuse libbpf from samples/bpf

Joe Stringer lkml netdev 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 0 repliesNew
  2. v37 patches 14 repliesApplied
  3. v22 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches10 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5samples/bpf: Make samples more libbpf-centricsamples/bpf/bpf_load.c samples/bpf/bpf_load.h samples/bpf/fds_example.c +27 more+133 -1090 replies
2/5samples/bpf: Switch over to libbpfsamples/bpf/Makefile samples/bpf/README.rst samples/bpf/bpf_load.c +7 more+52 -1680 replies
3/5tools lib bpf: Add bpf_prog_{attach,detach}samples/bpf/libbpf.c samples/bpf/libbpf.h tools/lib/bpf/bpf.c +1 more+24 -240 replies
4/5samples/bpf: Remove perf_event_open() declarationsamples/bpf/Makefile samples/bpf/bpf_load.c samples/bpf/libbpf.c +5 more+15 -180 replies
5/5samples/bpf: Move open_raw_sock to separate headersamples/bpf/Makefile samples/bpf/fds_example.c samples/bpf/libbpf.h +5 more+7 -60 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by.

PatchArnaldo Carvalho de Melo
1/5T-b
2/5T-b
3/5
4/5T-b
5/5

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

Read the v5 thread

Cover letter [PATCHv5 perf/core 0/5] Reuse libbpf from samples/bpf

Update tools/lib/bpf to provide the remaining bpf wrapper pieces needed by the samples/bpf/ code, then get rid of all of the duplicate BPF libraries in samples/bpf/libbpf.[ch].

---
v5: Fixed prog_size vs. instruction count API difference in bpf_load_program()

REBASE: Rebased v3 that was applied to perf/core.
Resolved merge conflict with net-next.
New patch shifts bpf_prog_{attach,detach}() to libbpf. Drop unnecessary build targets
Drop extra unneeded log buffers

v3: Add ack for first patch.
Split out second patch from v2 into separate changes for remaining diff. Add patches to switch samples/bpf over to using tools/lib/.

(Was "libbpf: Synchronize implementations")
v2: Don't shift non-bpf code into libbpf.
Drop the patch to synchronize ELF definitions with tc.

v1: https://www.mail-archive.com/[email protected]/msg135088.html
First post.

Joe Stringer (5):
samples/bpf: Make samples more libbpf-centric samples/bpf: Switch over to libbpf
tools lib bpf: Add bpf_prog_{attach,detach} samples/bpf: Remove perf_event_open() declaration samples/bpf: Move open_raw_sock to separate header

 samples/bpf/Makefile                              |  70 +++++----
 samples/bpf/README.rst                            |   4 +-
 samples/bpf/bpf_load.c                            |  21 ++-
 samples/bpf/bpf_load.h                            |   3 +
 samples/bpf/fds_example.c                         |  11 +-
 samples/bpf/lathist_user.c                        |   2 +-
 samples/bpf/libbpf.c                              | 176 ----------------------
 samples/bpf/libbpf.h                              |  28 +---
 samples/bpf/lwt_len_hist_user.c                   |   6 +-
 samples/bpf/offwaketime_user.c                    |   8 +-
 samples/bpf/sampleip_user.c                       |   7 +-
 samples/bpf/sock_example.c                        |  14 +-
 samples/bpf/sock_example.h                        |  35 +++++
 samples/bpf/sockex1_user.c                        |   7 +-
 samples/bpf/sockex2_user.c                        |   5 +-
 samples/bpf/sockex3_user.c                        |   5 +-
 samples/bpf/spintest_user.c                       |   8 +-
 samples/bpf/tc_l2_redirect_user.c                 |   4 +-
 samples/bpf/test_cgrp2_array_pin.c                |   4 +-
 samples/bpf/test_cgrp2_attach.c                   |  12 +-
 samples/bpf/test_cgrp2_attach2.c                  |   8 +-
 samples/bpf/test_cgrp2_sock.c                     |   7 +-
 samples/bpf/test_current_task_under_cgroup_user.c |   8 +-
 samples/bpf/test_lru_dist.c                       |  32 ++--
 samples/bpf/test_probe_write_user_user.c          |   2 +-
 samples/bpf/trace_event_user.c                    |  23 +--
 samples/bpf/trace_output_user.c                   |   5 +-
 samples/bpf/tracex2_user.c                        |  10 +-
 samples/bpf/tracex3_user.c                        |   4 +-
 samples/bpf/tracex4_user.c                        |   4 +-
 samples/bpf/tracex6_user.c                        |   5 +-
 samples/bpf/xdp1_user.c                           |   2 +-
 samples/bpf/xdp_tx_iptunnel_user.c                |   6 +-
 tools/lib/bpf/bpf.c                               |  21 +++
 tools/lib/bpf/bpf.h                               |   3 +
 35 files changed, 238 insertions(+), 332 deletions(-)
 delete mode 100644 samples/bpf/libbpf.c
 create mode 100644 samples/bpf/sock_example.h
Signature · 1 line
2.10.2