All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Quentin Monnet <quentin@isovalent.com>
Cc: bpf <bpf@vger.kernel.org>, "Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Jesper Dangaard Brouer" <jbrouer@redhat.com>,
	"Yauheni Kaliuta" <ykaliuta@redhat.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>
Subject: Re: How about adding a name for bpftool self created maps?
Date: Wed, 22 Jun 2022 18:15:09 +0800	[thread overview]
Message-ID: <YrLrrVMFApQdYpmL@Laptop-X1> (raw)
In-Reply-To: <CACdoK4JrrVoMjvwQusdpYOO5gDqZDKky2QZqyb08p+2R1186Gw@mail.gmail.com>

On Tue, Jun 21, 2022 at 10:28:27PM +0100, Quentin Monnet wrote:
> > When I using `bpftool map list` to show what maps user using. bpftool will
> > show maps including self created maps. Apart from the "pid_iter.rodata",
> > there are also array maps without name, which makes it hard to filter out
> > what maps user using. e.g.
> >
> > # bpftool map list
> > 63: array  flags 0x0
> >          key 4B  value 32B  max_entries 1  memlock 4096B
> > 65: array  name pid_iter.rodata  flags 0x480
> >          key 4B  value 4B  max_entries 1  memlock 4096B
> >          btf_id 98  frozen
> >          pids bpftool(10572)
> > 66: array  flags 0x0
> >          key 4B  value 32B  max_entries 1  memlock 4096B
> >
> > So do you have plan to add a special name for the bpftool self created maps?
> > Or do you know if there is a way to filter out these maps?
> 
> Hi Hangbin,
> 
> No plan currently. Adding names has been suggested before, but it's
> not compatible with some older kernels that don't support map names
> [0]. Maybe one solution would be to probe the kernel for map name
> support, and to add a name if supported.

Hi Quentin,

Thanks for the reply. Probe the kernel and add name if supported makes
sense to me.

Thanks
Hangbin

> 
> Other than this I'm not aware of a reliable way to filter out these
> maps at the moment. This could probably be done in bpftool since we
> should have the ids of the self-generated maps. But I think I'd rather
> find a way to add map names, if possible. It would make it easier to
> recognise/filter these maps on regular listing, whereas a new option
> would be harder for users to discover.
> 
> Quentin
> 
> [0] https://lore.kernel.org/bpf/CAEf4BzY66WPKQbDe74AKZ6nFtZjq5e+G3Ji2egcVytB9R6_sGQ@mail.gmail.com/

  reply	other threads:[~2022-06-22 10:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21  2:09 How about adding a name for bpftool self created maps? Hangbin Liu
2022-06-21 21:28 ` Quentin Monnet
2022-06-22 10:15   ` Hangbin Liu [this message]
2022-08-04  6:30   ` Hangbin Liu
2022-08-04 10:01     ` Quentin Monnet
2022-08-05  9:10       ` Hangbin Liu

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=YrLrrVMFApQdYpmL@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jbrouer@redhat.com \
    --cc=quentin@isovalent.com \
    --cc=toke@redhat.com \
    --cc=ykaliuta@redhat.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 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.