bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Paul Chaignon <paul.chaignon@orange.com>
Cc: bpf@vger.kernel.org,
	Quentin Monnet <quentin.monnet@netronome.com>,
	paul.chaignon@gmail.com, netdev@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>
Subject: Re: [PATCH bpf-next v2 0/3] bpftool: match programs and maps by names
Date: Sun, 15 Dec 2019 09:40:05 -0800	[thread overview]
Message-ID: <20191215174004.57deg3fs7665jokd@ast-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <cover.1576263640.git.paul.chaignon@gmail.com>

On Fri, Dec 13, 2019 at 08:09:52PM +0100, Paul Chaignon wrote:
> When working with frequently modified BPF programs, both the ID and the
> tag may change.  bpftool currently doesn't provide a "stable" way to match
> such programs.  This patchset allows bpftool to match programs and maps by
> name.
> 
> When given a tag that matches several programs, bpftool currently only
> considers the first match.  The first patch changes that behavior to
> either process all matching programs (for the show and dump commands) or
> error out.  The second patch implements program lookup by name, with the
> same behavior as for tags in case of ambiguity.  The last patch implements
> map lookup by name.
> 
> Changelogs:
>   Changes in v2:
>     - Fix buffer overflow after realloc.
>     - Add example output to commit message.
>     - Properly close JSON arrays on errors.
>     - Fix style errors (line breaks, for loops, exit labels, type for
>       tagname).
>     - Move do_show code for argc == 2 to do_show_subset functions.
>     - Rebase.

Loogs good. Applied.

I found the exact match logic unintuitive though.
Since 'prog show' can print multiple may be allow partial match on name?
So 'bpftool p s name tracepoint__' would print all BCC-based programs
that attach to tracepoints.
It would be roughly equivalent to 'bpftool p s |grep tracepoint__',
but grep captures single line.
There is 'bpftool perf|grep tracepoint' as well, but since the tool
matches on name it probably should match partial name too.


  parent reply	other threads:[~2019-12-15 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 19:09 [PATCH bpf-next v2 0/3] bpftool: match programs and maps by names Paul Chaignon
2019-12-13 19:10 ` [PATCH bpf-next v2 1/3] bpftool: match several programs with same tag Paul Chaignon
2019-12-13 19:10 ` [PATCH bpf-next v2 2/3] bpftool: match programs by name Paul Chaignon
2019-12-13 19:10 ` [PATCH bpf-next v2 3/3] bpftool: match maps " Paul Chaignon
2019-12-15 17:40 ` Alexei Starovoitov [this message]
2019-12-18 19:29   ` [PATCH bpf-next v2 0/3] bpftool: match programs and maps by names Paul Chaignon

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=20191215174004.57deg3fs7665jokd@ast-mbp.dhcp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.chaignon@gmail.com \
    --cc=paul.chaignon@orange.com \
    --cc=quentin.monnet@netronome.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;
as well as URLs for NNTP newsgroup(s).