linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Networking <netdev@vger.kernel.org>, bpf <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>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCHv4 bpf-next 0/5] bpf: Speed up symbol resolving in kprobe multi link
Date: Sat, 30 Apr 2022 14:14:10 +0200	[thread overview]
Message-ID: <Ym0oEo4iwr4F2jMT@krava> (raw)
In-Reply-To: <CAEf4BzYtXWvBWzmadhLGqwf8_e2sruK6999th6c=b=O0WLkHOA@mail.gmail.com>

On Fri, Apr 29, 2022 at 07:28:11AM -0700, Andrii Nakryiko wrote:
> On Thu, Apr 28, 2022 at 1:12 PM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > 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% )
> >
> > v4 changes:
> >   - fix compile issue [kernel test robot]
> >   - added acks [Andrii]
> >
> > v3 changes:
> >   - renamed kallsyms_lookup_names to ftrace_lookup_symbols
> >     and moved it to ftrace.c [Masami]
> >   - added ack [Andrii]
> >   - couple small test fixes [Andrii]
> >
> > 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 (5):
> >       kallsyms: Fully export kallsyms_on_each_symbol function
> >       ftrace: Add ftrace_lookup_symbols function
> >       fprobe: Resolve symbols with ftrace_lookup_symbols
> >       bpf: Resolve symbols with ftrace_lookup_symbols for kprobe multi link
> >       selftests/bpf: Add attach bench test
> >
> 
> Please check [0], it reports rcu_read_unlock() misuse
> 
>   [0] https://github.com/kernel-patches/bpf/runs/6223167405?check_suite_focus=true

hm, first I though it might be related to the bench test
attaching to 'bad' function, but the the warning showed
before that

will try to reproduce  with the CI .config

jirka


> 
> >  include/linux/ftrace.h                                     |   6 ++++++
> >  include/linux/kallsyms.h                                   |   7 ++++++-
> >  kernel/kallsyms.c                                          |   3 +--
> >  kernel/trace/bpf_trace.c                                   | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------
> >  kernel/trace/fprobe.c                                      |  32 ++++++++++++--------------------
> >  kernel/trace/ftrace.c                                      |  62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tools/testing/selftests/bpf/progs/kprobe_multi_empty.c     |  12 ++++++++++++
> >  8 files changed, 298 insertions(+), 69 deletions(-)
> >  create mode 100644 tools/testing/selftests/bpf/progs/kprobe_multi_empty.c

      reply	other threads:[~2022-04-30 12:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 20:12 [PATCHv4 bpf-next 0/5] bpf: Speed up symbol resolving in kprobe multi link Jiri Olsa
2022-04-28 20:12 ` [PATCHv4 bpf-next 1/5] kallsyms: Fully export kallsyms_on_each_symbol function Jiri Olsa
2022-04-29 14:51   ` Masami Hiramatsu
2022-04-28 20:12 ` [PATCHv4 bpf-next 2/5] ftrace: Add ftrace_lookup_symbols function Jiri Olsa
2022-04-29 14:56   ` Masami Hiramatsu
2022-04-28 20:12 ` [PATCHv4 bpf-next 3/5] fprobe: Resolve symbols with ftrace_lookup_symbols Jiri Olsa
2022-04-29 14:54   ` Masami Hiramatsu
2022-04-28 20:12 ` [PATCHv4 bpf-next 4/5] bpf: Resolve symbols with ftrace_lookup_symbols for kprobe multi link Jiri Olsa
2022-04-28 20:12 ` [PATCHv4 bpf-next 5/5] selftests/bpf: Add attach bench test Jiri Olsa
2022-04-29 14:28 ` [PATCHv4 bpf-next 0/5] bpf: Speed up symbol resolving in kprobe multi link Andrii Nakryiko
2022-04-30 12:14   ` Jiri Olsa [this message]

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=Ym0oEo4iwr4F2jMT@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.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).