Skip to content

samples: bpf: Refactor tracing programs with libbpf

Daniel T. Lee bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3samples: bpf: cleanup bpf_load.o from Makefilesamples/bpf/Makefile+1 -10 replies
2/3samples: bpf: Refactor kprobe tracing programs with libbpfsamples/bpf/Makefile samples/bpf/lathist_kern.c samples/bpf/lathist_user.c +8 more+272 -1180 replies
3/3samples: bpf: Refactor tracepoint tracing programs with libbpfsamples/bpf/Makefile samples/bpf/cpustat_kern.c samples/bpf/cpustat_user.c +4 more+192 -930 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] samples: bpf: Refactor tracing programs with libbpf

For the problem of increasing fragmentation of the bpf loader programs, instead of using bpf_loader.o, which is used in samples/bpf, this patch refactors the existing kprobe, tracepoint tracing programs with libbbpf bpf loader.

- For kprobe events pointing to system calls, the SYSCALL() macro in trace_common.h was used.
- Adding a kprobe/tracepoint event and attaching a bpf program to it was done through bpf_program_attach().
- Instead of using the existing BPF MAP definition, MAP definition has been refactored with the new BTF-defined MAP format.

Daniel T. Lee (3):
samples: bpf: cleanup bpf_load.o from Makefile
samples: bpf: Refactor kprobe tracing programs with libbpf
samples: bpf: Refactor tracepoint tracing programs with libbpf

 samples/bpf/Makefile                          | 18 ++---
 samples/bpf/cpustat_kern.c                    | 36 +++++-----
 samples/bpf/cpustat_user.c                    | 47 +++++++++++--
 samples/bpf/lathist_kern.c                    | 24 +++----
 samples/bpf/lathist_user.c                    | 42 ++++++++++--
 samples/bpf/offwaketime_kern.c                | 52 +++++++-------
 samples/bpf/offwaketime_user.c                | 66 ++++++++++++++----
 samples/bpf/spintest_kern.c                   | 36 +++++-----
 samples/bpf/spintest_user.c                   | 68 +++++++++++++++----
 samples/bpf/syscall_tp_kern.c                 | 24 +++----
 samples/bpf/syscall_tp_user.c                 | 54 +++++++++++----
 .../bpf/test_current_task_under_cgroup_kern.c | 27 ++++----
 .../bpf/test_current_task_under_cgroup_user.c | 52 +++++++++++---
 samples/bpf/test_probe_write_user_kern.c      | 12 ++--
 samples/bpf/test_probe_write_user_user.c      | 49 ++++++++++---
 samples/bpf/trace_output_kern.c               | 15 ++--
 samples/bpf/trace_output_user.c               | 55 ++++++++++-----
 17 files changed, 465 insertions(+), 212 deletions(-)
Signature · 1 line
2.25.1