From: Jiri Olsa <jolsa@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
lkml <linux-kernel@vger.kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>
Subject: [PATCHv2 bpf-next 0/4] bpf: Speed up symbol resolving in kprobe multi link
Date: Mon, 18 Apr 2022 14:48:30 +0200 [thread overview]
Message-ID: <20220418124834.829064-1-jolsa@kernel.org> (raw)
hi,
sending additional fix for symbol resolving in kprobe multi link
requested by Alexei and Andrii [1].
This speeds up bpftrace kprobe attachment, when using pure symbols
(3344 symbols) to attach:
Before:
# perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }'
...
6.5681 +- 0.0225 seconds time elapsed ( +- 0.34% )
After:
# perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }'
...
0.5661 +- 0.0275 seconds time elapsed ( +- 4.85% )
v2 changes (first version [2]):
- removed the 2 seconds check [Alexei]
- moving/forcing symbols sorting out of kallsyms_lookup_names function [Alexei]
- skipping one array allocation and copy_from_user [Andrii]
- several small fixes [Masami,Andrii]
- build fix [kernel test robot]
thanks,
jirka
[1] https://lore.kernel.org/bpf/CAEf4BzZtQaiUxQ-sm_hH2qKPRaqGHyOfEsW96DxtBHRaKLoL3Q@mail.gmail.com/
[2] https://lore.kernel.org/bpf/20220407125224.310255-1-jolsa@kernel.org/
---
Jiri Olsa (4):
kallsyms: Add kallsyms_lookup_names function
fprobe: Resolve symbols with kallsyms_lookup_names
bpf: Resolve symbols with kallsyms_lookup_names for kprobe multi link
selftests/bpf: Add attach bench test
include/linux/kallsyms.h | 6 ++++++
kernel/kallsyms.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
kernel/trace/bpf_trace.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------
kernel/trace/fprobe.c | 32 ++++++++++++--------------------
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/testing/selftests/bpf/progs/kprobe_multi_empty.c | 12 ++++++++++++
6 files changed, 302 insertions(+), 67 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/kprobe_multi_empty.c
next reply other threads:[~2022-04-18 13:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 12:48 Jiri Olsa [this message]
2022-04-18 12:48 ` [PATCHv2 bpf-next 1/4] kallsyms: Add kallsyms_lookup_names function Jiri Olsa
2022-04-18 14:35 ` Masami Hiramatsu
2022-04-19 8:26 ` Jiri Olsa
2022-04-22 6:47 ` Jiri Olsa
2022-04-26 10:01 ` Masami Hiramatsu
2022-04-26 12:27 ` Jiri Olsa
2022-04-26 16:03 ` Masami Hiramatsu
2022-04-18 12:48 ` [PATCHv2 bpf-next 2/4] fprobe: Resolve symbols with kallsyms_lookup_names Jiri Olsa
2022-04-18 14:39 ` Masami Hiramatsu
2022-04-18 12:48 ` [PATCHv2 bpf-next 3/4] bpf: Resolve symbols with kallsyms_lookup_names for kprobe multi link Jiri Olsa
2022-04-20 21:49 ` Andrii Nakryiko
2022-04-21 6:49 ` Jiri Olsa
2022-04-18 12:48 ` [PATCHv2 bpf-next 4/4] selftests/bpf: Add attach bench test Jiri Olsa
2022-04-20 21:56 ` Andrii Nakryiko
2022-04-21 6:56 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220418124834.829064-1-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).