RFC bpf: Add support for ftrace probe
Get series with b4
b4 am [email protected]Versions newest first
- v2 RFC Latest7 patches 31 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | bpf: Move bpf_prog_start/end functions to generic placekernel/ kernel/ | +97 | 0 replies | |
| 2/7 | bpf: Add bpf_functions objectinclude/ kernel/ tools/ | +147 | 0 replies | |
| 3/7 | bpf: Add support to attach program to ftrace probeinclude/ kernel/ kernel/ +2 more | +184 | 0 replies | |
| 4/7 | libbpf: Add btf__find_by_pattern_kind functiontools/ tools/ | +71 | 0 replies | |
| 5/7 | libbpf: Add support to load and attach ftrace probetools/ tools/ tools/ +1 more | +91 | 0 replies | |
| 6/7 | selftests/bpf: Add ftrace probe to fentry testtools/ tools/ | +20 | 0 replies | |
| 7/7 | selftests/bpf: Add ftrace probe testtools/ tools/ | +65 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe
hi,
sending another attempt on speeding up load of multiple probes for bpftrace and possibly other tools (first post in [1]).
This patchset adds support to attach bpf program directly to ftrace probe as suggested by Steven and it speeds up loading for bpftrace commands like:
# bpftrace -e 'kfunc:_raw_spin* { @[probe] = count(); }'
# bpftrace -e 'kfunc:ksys_* { @[probe] = count(); }'Using ftrace with single bpf program for attachment to multiple functions is much faster than current approach, where we need to load and attach program for each probe function.
Also available in
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
bpf/ftrace
thanks,
jirka
[1] https://lore.kernel.org/bpf/[email protected]/
---
Jiri Olsa (7):
bpf: Move bpf_prog_start/end functions to generic place
bpf: Add bpf_functions object
bpf: Add support to attach program to ftrace probe
libbpf: Add btf__find_by_pattern_kind function
libbpf: Add support to load and attach ftrace probe selftests/bpf: Add ftrace probe to fentry test selftests/bpf: Add ftrace probe test
include/uapi/linux/bpf.h | 8 ++++ kernel/bpf/syscall.c | 381 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ kernel/bpf/trampoline.c | 97 --------------------------------------- kernel/bpf/verifier.c | 27 +++++++++++ net/bpf/test_run.c | 1 + tools/include/uapi/linux/bpf.h | 8 ++++ tools/lib/bpf/bpf.c | 12 +++++ tools/lib/bpf/bpf.h | 5 +- tools/lib/bpf/btf.c | 67 +++++++++++++++++++++++++++ tools/lib/bpf/btf.h | 3 ++ tools/lib/bpf/libbpf.c | 74 ++++++++++++++++++++++++++++++ tools/lib/bpf/libbpf.map | 1 + tools/testing/selftests/bpf/prog_tests/fentry_test.c | 5 +- tools/testing/selftests/bpf/prog_tests/ftrace_test.c | 48 +++++++++++++++++++ tools/testing/selftests/bpf/progs/fentry_test.c | 16 +++++++ tools/testing/selftests/bpf/progs/ftrace_test.c | 17 +++++++ 16 files changed, 671 insertions(+), 99 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/ftrace_test.c create mode 100644 tools/testing/selftests/bpf/progs/ftrace_test.c