From: Jiri Olsa <olsajiri@gmail.com>
To: Pu Lehui <pulehui@huaweicloud.com>
Cc: bpf@vger.kernel.org, linux-riscv@lists.infradead.org,
netdev@vger.kernel.org, "Björn Töpel" <bjorn@kernel.org>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"John Fastabend" <john.fastabend@gmail.com>,
"KP Singh" <kpsingh@kernel.org>,
"Stanislav Fomichev" <sdf@google.com>,
"Hao Luo" <haoluo@google.com>,
"Puranjay Mohan" <puranjay@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Pu Lehui" <pulehui@huawei.com>
Subject: Re: [PATCH bpf-next v5 2/3] selftests/bpf: Factor out many args tests from tracing_struct
Date: Tue, 2 Jul 2024 13:06:49 +0200 [thread overview]
Message-ID: <ZoPfSe-CvdEwlxjo@krava> (raw)
In-Reply-To: <20240702013730.1082285-3-pulehui@huaweicloud.com>
On Tue, Jul 02, 2024 at 01:37:29AM +0000, Pu Lehui wrote:
SNIP
> +
> +static void test_struct_many_args(void)
> +{
> + struct tracing_struct_many_args *skel;
> + int err;
> +
> + skel = tracing_struct_many_args__open_and_load();
> + if (!ASSERT_OK_PTR(skel, "tracing_struct_many_args__open_and_load"))
> + return;
> +
> + err = tracing_struct_many_args__attach(skel);
> + if (!ASSERT_OK(err, "tracing_struct_many_args__attach"))
> + goto destroy_skel;
> +
> + ASSERT_OK(trigger_module_test_read(256), "trigger_read");
> +
> ASSERT_EQ(skel->bss->t7_a, 16, "t7:a");
> ASSERT_EQ(skel->bss->t7_b, 17, "t7:b");
> ASSERT_EQ(skel->bss->t7_c, 18, "t7:c");
> @@ -74,12 +95,15 @@ static void test_fentry(void)
> ASSERT_EQ(skel->bss->t8_g, 23, "t8:g");
> ASSERT_EQ(skel->bss->t8_ret, 156, "t8 ret");
>
> - tracing_struct__detach(skel);
> + tracing_struct_many_args__detach(skel);
nit, I know it's in the current code, but tracing_struct_many_args__destroy
will take care of the detach, so no need to call it explicitly
jirka
> destroy_skel:
> - tracing_struct__destroy(skel);
> + tracing_struct_many_args__destroy(skel);
> }
>
SNIP
next prev parent reply other threads:[~2024-07-02 11:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 1:37 [PATCH bpf-next v5 0/3] Add 12-argument support for RV64 bpf trampoline Pu Lehui
2024-07-02 1:37 ` [PATCH bpf-next v5 1/3] riscv, bpf: " Pu Lehui
2024-07-02 1:37 ` [PATCH bpf-next v5 2/3] selftests/bpf: Factor out many args tests from tracing_struct Pu Lehui
2024-07-02 11:06 ` Jiri Olsa [this message]
2024-07-02 11:57 ` Pu Lehui
2024-07-02 1:37 ` [PATCH bpf-next v5 3/3] selftests/bpf: Add testcase where 7th argment is struct Pu Lehui
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=ZoPfSe-CvdEwlxjo@krava \
--to=olsajiri@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=palmer@dabbelt.com \
--cc=pulehui@huawei.com \
--cc=pulehui@huaweicloud.com \
--cc=puranjay@kernel.org \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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).