BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>, andrii@kernel.org
Cc: acme@redhat.com, ast@kernel.org, daniel@iogearbox.net,
	jolsa@kernel.org, martin.lau@linux.dev, song@kernel.org,
	yonghong.song@linux.dev,  john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	 mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org,
	mykolal@fb.com,  thinker.li@gmail.com, bentiss@kernel.org,
	tanggeliang@kylinos.cn, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 5/5] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod
Date: Wed, 19 Jun 2024 13:12:17 -0700	[thread overview]
Message-ID: <e17f8c4d644a6f4aa80de092ee29e6c1e5e77c52.camel@gmail.com> (raw)
In-Reply-To: <9359e765-c341-4164-90fd-78feafed89d5@oracle.com>

On Wed, 2024-06-19 at 18:42 +0100, Alan Maguire wrote:

[...]

> Sorry, I'm not following here. So I think what you'd like is a way to
> verify that the dtor actually runs, is that right? The problem there is
> that the map cleanup gets run when the skeleton gets destroyed, but then
> it's too late then to collect a count value via that BPF object.
> 
> The only thing I can think of is to create an additional tracing object
> that we separately load/attach to bpf_testmod_ctx_release() prior to
> running kfunc call tests to verify that the destructor fires on cleanup
> of the kfunc test skeletons. Is that what you have in mind? Thanks!

Tracing program could be an option, yes.
I was thinking about some map created by the driver program (the one
from prog_tests) that could be updated by destructor.
There is a question of how to pass the map FD to the kfunc,
probably it could be passed in a constructor for the kfunc and stored
in the context. But tracing program sounds good as well.

Again, it might be the case that checking that registration logic
works is sufficient. In such a case bodies of both kfunc and BPF
program could be empty.


  reply	other threads:[~2024-06-19 20:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240618160454.801527-1-alan.maguire@oracle.com>
     [not found] ` <20240618160454.801527-6-alan.maguire@oracle.com>
     [not found]   ` <4321b99db5b362e278b1f37d6bd9b9a43d859d63.camel@gmail.com>
     [not found]     ` <76509fc5411e35a4820c333abca155b3fa4e5b84.camel@gmail.com>
2024-06-19 16:45       ` [PATCH bpf-next 5/5] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod Alan Maguire
2024-06-19 16:54         ` Eduard Zingerman
2024-06-19 17:42           ` Alan Maguire
2024-06-19 20:12             ` Eduard Zingerman [this message]
2024-06-20  9:17               ` Alan Maguire
2024-06-20 11:02                 ` Eduard Zingerman
2024-06-18 16:24 [PATCH bpf-next 0/5] bpf: resilient split BTF followups Alan Maguire
2024-06-18 16:24 ` [PATCH bpf-next 5/5] selftests/bpf: add kfunc_call test for simple dtor in bpf_testmod Alan Maguire

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=e17f8c4d644a6f4aa80de092ee29e6c1e5e77c52.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=acme@redhat.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bentiss@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mykolal@fb.com \
    --cc=nathan@kernel.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=tanggeliang@kylinos.cn \
    --cc=thinker.li@gmail.com \
    --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