All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next 2/3] selftest/bpf: fmod_ret prog and implement test_overhead as part of bench
Date: Fri, 8 May 2020 11:01:44 -0700	[thread overview]
Message-ID: <CAEf4BzZ0ydoZa_Y0NvHgEqMM-QffKZW7jR4-Bxo5gr5A-Scqgg@mail.gmail.com> (raw)
In-Reply-To: <5eb5817b12a3b_2a992ad50b5cc5b4b7@john-XPS-13-9370.notmuch>

On Fri, May 8, 2020 at 8:57 AM John Fastabend <john.fastabend@gmail.com> wrote:
>
> Andrii Nakryiko wrote:
> > Add fmod_ret BPF program to existing test_overhead selftest. Also re-implement
> > user-space benchmarking part into benchmark runner to compare results.  Results
> > with ./bench are consistently somewhat lower than test_overhead's, but relative
> > performance of various types of BPF programs stay consisten (e.g., kretprobe is
> > noticeably slower).
> >
> > To test with ./bench, the following command was used:
> >
> > for i in base kprobe kretprobe rawtp fentry fexit fmodret; \
> > do \
> >     summary=$(sudo ./bench -w2 -d5 -a rename-$i | \
> >               tail -n1 | cut -d'(' -f1 | cut -d' ' -f3-) && \
> >     printf "%-10s: %s\n" $i "$summary"; \
> > done
>
> might be nice to have a script ./bench_tracing_overhead.sh when its in its
> own directory ./bench. Otherwise I'll have to look this up every single
> time I'm sure.

Yeah, I didn't want to pollute selftests/bpf directory, but with a
separate subdir it makes more sense. I'll put it there. For ringbuf
I'll have much longer scripts, so having them in file is a necessity.

>
> >
> > This gives the following numbers:
> >
> >   base      :    3.975 ± 0.065M/s
> >   kprobe    :    3.268 ± 0.095M/s
> >   kretprobe :    2.496 ± 0.040M/s
> >   rawtp     :    3.899 ± 0.078M/s
> >   fentry    :    3.836 ± 0.049M/s
> >   fexit     :    3.660 ± 0.082M/s
> >   fmodret   :    3.776 ± 0.033M/s
> >
> > While running test_overhead gives:
> >
> >   task_rename base        4457K events per sec
> >   task_rename kprobe      3849K events per sec
> >   task_rename kretprobe   2729K events per sec
> >   task_rename raw_tp      4506K events per sec
> >   task_rename fentry      4381K events per sec
> >   task_rename fexit       4349K events per sec
> >   task_rename fmod_ret    4130K events per sec
> >
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> > ---
>
> LGTM
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2020-05-08 18:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  7:05 [PATCH bpf-next 0/3] Add benchmark runner and few benchmarks Andrii Nakryiko
2020-05-08  7:05 ` [PATCH bpf-next 1/3] selftests/bpf: add benchmark runner infrastructure Andrii Nakryiko
2020-05-08 15:49   ` John Fastabend
2020-05-08 17:59     ` Andrii Nakryiko
2020-05-08  7:05 ` [PATCH bpf-next 2/3] selftest/bpf: fmod_ret prog and implement test_overhead as part of bench Andrii Nakryiko
2020-05-08 15:57   ` John Fastabend
2020-05-08 18:01     ` Andrii Nakryiko [this message]
2020-05-08  7:05 ` [PATCH bpf-next 3/3] selftest/bpf: add BPF triggring benchmark Andrii Nakryiko
2020-05-08 16:02   ` John Fastabend
2020-05-08 16:40   ` Alexei Starovoitov
2020-05-08 17:50     ` Andrii Nakryiko

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=CAEf4BzZ0ydoZa_Y0NvHgEqMM-QffKZW7jR4-Bxo5gr5A-Scqgg@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.