public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <olsajiri@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Kui-Feng Lee <kuifeng@fb.com>,
	bpf@vger.kernel.org, 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>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: Add missing bpf_iter_vma_offset__destroy call
Date: Thu, 6 Oct 2022 09:03:56 +0200	[thread overview]
Message-ID: <Yz593OOQ+M91ERo5@krava> (raw)
In-Reply-To: <CAEf4BzZay5mLX04C7Hk0xawpTvMMX+JXoRvh4_Z19DBoOnmFaw@mail.gmail.com>

On Wed, Oct 05, 2022 at 03:58:45PM -0700, Andrii Nakryiko wrote:
> On Tue, Oct 4, 2022 at 5:16 AM Jiri Olsa <olsajiri@gmail.com> wrote:
> >
> > On Tue, Oct 04, 2022 at 08:38:23AM +0200, Jiri Olsa wrote:
> > > On Mon, Oct 03, 2022 at 05:12:44PM -0700, Martin KaFai Lau wrote:
> > > > On 10/2/22 8:11 AM, Jiri Olsa wrote:
> > > > > Adding missing bpf_iter_vma_offset__destroy call to
> > > > > test_task_vma_offset_common function and related goto jumps.
> > > > >
> > > > > Fixes: b3e1331eb925 ("selftests/bpf: Test parameterized task BPF iterators.")
> > > > > Cc: Kui-Feng Lee <kuifeng@fb.com>
> > > > > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > > > > ---
> > > > >   tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 8 +++++---
> > > > >   1 file changed, 5 insertions(+), 3 deletions(-)
> > > > >
> > > > > diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
> > > > > index 3369c5ec3a17..462fe92e0736 100644
> > > > > --- a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
> > > > > +++ b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
> > > > > @@ -1515,11 +1515,11 @@ static void test_task_vma_offset_common(struct bpf_iter_attach_opts *opts, bool
> > > > >           link = bpf_program__attach_iter(skel->progs.get_vma_offset, opts);
> > > >
> > > > Thanks for the fix.
> > > >
> > > > A nit.  Instead of adding a new goto label.  How about doing
> > > >
> > > >     skel->links.get_vma_offset = bpf_program_attach_iter(...)
> > > >
> > > > and bpf_iter_vma_offset__destroy(skel) will take care of the link destroy.
> > > > The earlier test_task_vma_common() is doing that also.
> > >
> > > right, I forgot destroy would do that.. it'll be simpler change
> >
> > ugh actually no ;-) it's outside (of skeleton) link,
> > so it won't get closed in bpf_iter_vma_offset__destroy
> 
> Martin's point was that if you assign it to skel->links.get_vma_offset
> it will be closed by skeleton's destroy method. So let's do that?

ah ok, will send new version

thanks,
jirka

      reply	other threads:[~2022-10-06  7:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 15:11 [PATCH bpf-next] selftests/bpf: Add missing bpf_iter_vma_offset__destroy call Jiri Olsa
2022-10-04  0:12 ` Martin KaFai Lau
2022-10-04  6:38   ` Jiri Olsa
2022-10-04 12:16     ` Jiri Olsa
2022-10-05 22:58       ` Andrii Nakryiko
2022-10-06  7:03         ` 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=Yz593OOQ+M91ERo5@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=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@chromium.org \
    --cc=kuifeng@fb.com \
    --cc=martin.lau@linux.dev \
    --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