[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210413121516.1467989-1-jolsa@kernel.org>
Date: Tue, 13 Apr 2021 14:15:09 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andriin@...com>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>, Daniel Xu <dxu@...uu.xyz>,
Steven Rostedt <rostedt@...dmis.org>,
Jesper Brouer <jbrouer@...hat.com>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Viktor Malik <vmalik@...hat.com>
Subject: [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/20201022082138.2322434-1-jolsa@kernel.org/
---
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
Powered by blists - more mailing lists