From: Jiri Olsa <olsajiri@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@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>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Yafang Shao <laoar.shao@gmail.com>
Subject: Re: [PATCHv5 bpf-next 25/28] selftests/bpf: Add uprobe_multi usdt bench test
Date: Wed, 2 Aug 2023 10:24:44 +0200 [thread overview]
Message-ID: <ZMoSzH/3D447BW+9@krava> (raw)
In-Reply-To: <CAADnVQKdrMo+sMNbuKZt1HU5RXN7qfN+kEyTWXtN3U5uvGRjrQ@mail.gmail.com>
On Tue, Aug 01, 2023 at 10:51:35AM -0700, Alexei Starovoitov wrote:
> On Sun, Jul 30, 2023 at 6:46 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > Adding test that attaches 50k usdt probes in usdt_multi binary.
> >
> > After the attach is done we run the binary and make sure we get
> > proper amount of hits.
> >
> > With current uprobes:
> >
> > # perf stat --null ./test_progs -n 254/6
> > #254/6 uprobe_multi_test/bench_usdt:OK
> > #254 uprobe_multi_test:OK
> > Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED
> >
> > Performance counter stats for './test_progs -n 254/6':
> >
> > 1353.659680562 seconds time elapsed
> >
> > With uprobe_multi link:
> >
> > # perf stat --null ./test_progs -n 254/6
> > #254/6 uprobe_multi_test/bench_usdt:OK
> > #254 uprobe_multi_test:OK
> > Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED
> >
> > Performance counter stats for './test_progs -n 254/6':
> >
> > 0.322046364 seconds time elapsed
> >
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> > .../bpf/prog_tests/uprobe_multi_test.c | 39 +++++++++++++++++++
> > .../selftests/bpf/progs/uprobe_multi_usdt.c | 16 ++++++++
> > 2 files changed, 55 insertions(+)
> > create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_usdt.c
> >
> > diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
> > index 56c2062af1c9..19a66431a61f 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
> > @@ -4,6 +4,7 @@
> > #include <test_progs.h>
> > #include "uprobe_multi.skel.h"
> > #include "uprobe_multi_bench.skel.h"
> > +#include "uprobe_multi_usdt.skel.h"
> > #include "bpf/libbpf_internal.h"
> > #include "testing_helpers.h"
> >
> > @@ -234,6 +235,42 @@ static void test_bench_attach_uprobe(void)
> > printf("%s: detached in %7.3lfs\n", __func__, detach_delta);
> > }
> >
> > +static void test_bench_attach_usdt(void)
> > +{
> > + struct uprobe_multi_usdt *skel = NULL;
> > + long attach_start_ns, attach_end_ns;
> > + long detach_start_ns, detach_end_ns;
> > + double attach_delta, detach_delta;
> > +
> > + skel = uprobe_multi_usdt__open_and_load();
> > + if (!ASSERT_OK_PTR(skel, "uprobe_multi__open"))
> > + goto cleanup;
> > +
> > + attach_start_ns = get_time_ns();
> > +
> > + skel->links.usdt0 = bpf_program__attach_usdt(skel->progs.usdt0, -1, "./uprobe_multi",
> > + "test", "usdt", NULL);
> > + if (!ASSERT_OK_PTR(skel->links.usdt0, "bpf_program__attach_usdt"))
> > + goto cleanup;
> > +
> > + attach_end_ns = get_time_ns();
> > +
> > + system("./uprobe_multi usdt");
> > +
> > + ASSERT_EQ(skel->bss->count, 50000, "usdt_count");
> > +
> > +cleanup:
> > + detach_start_ns = get_time_ns();
> > + uprobe_multi_usdt__destroy(skel);
> > + detach_end_ns = get_time_ns();
> > +
> > + attach_delta = (attach_end_ns - attach_start_ns) / 1000000000.0;
> > + detach_delta = (detach_end_ns - detach_start_ns) / 1000000000.0;
> > +
> > + printf("%s: attached in %7.3lfs\n", __func__, attach_delta);
> > + printf("%s: detached in %7.3lfs\n", __func__, detach_delta);
> > +}
>
> It fails CI.
> /tmp/work/bpf/bpf/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c:338:6:
> error: variable 'attach_start_ns' is used uninitialized whenever 'if'
> condition is true [-Werror,-Wsometimes-uninitialized]
> if (!ASSERT_OK_PTR(skel, "uprobe_multi__open"))
hum, one more change is needed.. will fix
thanks,
jirka
next prev parent reply other threads:[~2023-08-02 8:24 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-30 13:41 [PATCHv5 bpf-next 00/28] bpf: Add multi uprobe link Jiri Olsa
2023-07-30 13:41 ` [PATCHv5 bpf-next 01/28] bpf: Switch BPF_F_KPROBE_MULTI_RETURN macro to enum Jiri Olsa
2023-07-31 2:49 ` Yafang Shao
2023-07-30 13:41 ` [PATCHv5 bpf-next 02/28] bpf: Add attach_type checks under bpf_prog_attach_check_attach_type Jiri Olsa
2023-07-31 3:03 ` Yafang Shao
2023-07-30 13:41 ` [PATCHv5 bpf-next 03/28] bpf: Add multi uprobe link Jiri Olsa
2023-07-31 3:27 ` Yafang Shao
2023-07-30 13:41 ` [PATCHv5 bpf-next 04/28] bpf: Add cookies support for uprobe_multi link Jiri Olsa
2023-07-31 3:33 ` Yafang Shao
2023-07-30 13:42 ` [PATCHv5 bpf-next 05/28] bpf: Add pid filter " Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 06/28] bpf: Add bpf_get_func_ip helper support for uprobe link Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 07/28] libbpf: Add uprobe_multi attach type and link names Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 08/28] libbpf: Move elf_find_func_offset* functions to elf object Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 09/28] libbpf: Add elf_open/elf_close functions Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 10/28] libbpf: Add elf symbol iterator Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 11/28] libbpf: Add elf_resolve_syms_offsets function Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 12/28] libbpf: Add elf_resolve_pattern_offsets function Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 13/28] libbpf: Add bpf_link_create support for multi uprobes Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 14/28] libbpf: Add bpf_program__attach_uprobe_multi function Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 15/28] libbpf: Add support for u[ret]probe.multi[.s] program sections Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 16/28] libbpf: Add uprobe multi link detection Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 17/28] libbpf: Add uprobe multi link support to bpf_program__attach_usdt Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 18/28] selftests/bpf: Move get_time_ns to testing_helpers.h Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 19/28] selftests/bpf: Add uprobe_multi skel test Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 20/28] selftests/bpf: Add uprobe_multi api test Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 21/28] selftests/bpf: Add uprobe_multi link test Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 22/28] selftests/bpf: Add uprobe_multi test program Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 23/28] selftests/bpf: Add uprobe_multi bench test Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 24/28] selftests/bpf: Add uprobe_multi usdt test code Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 25/28] selftests/bpf: Add uprobe_multi usdt bench test Jiri Olsa
2023-08-01 17:51 ` Alexei Starovoitov
2023-08-02 8:24 ` Jiri Olsa [this message]
2023-07-30 13:42 ` [PATCHv5 bpf-next 26/28] selftests/bpf: Add uprobe_multi cookie test Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 27/28] selftests/bpf: Add uprobe_multi pid filter tests Jiri Olsa
2023-07-30 13:42 ` [PATCHv5 bpf-next 28/28] selftests/bpf: Add extra link to uprobe_multi tests 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=ZMoSzH/3D447BW+9@krava \
--to=olsajiri@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=laoar.shao@gmail.com \
--cc=sdf@google.com \
--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