BPF List
 help / color / mirror / Atom feed
From: Andrey Ignatov <rdna@fb.com>
To: Song Liu <songliubraving@fb.com>
Cc: bpf <bpf@vger.kernel.org>, "ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	Omar Sandoval <osandov@fb.com>, Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH bpf-next] bpf: Add drgn script to list progs/maps
Date: Thu, 27 Feb 2020 09:01:03 -0800	[thread overview]
Message-ID: <20200227170103.GA29488@rdna-mbp> (raw)
In-Reply-To: <CE954665-BFCB-4E83-B20F-AECD12E180D2@fb.com>

Song Liu <songliubraving@fb.com> [Wed, 2020-02-26 21:45 -0800]:
> 
> 
> > On Feb 26, 2020, at 6:32 PM, Andrey Ignatov <rdna@fb.com> wrote:
> > 
> > The main use-case bpf.py covers is to show BPF programs attached to
> > other BPF programs via freplace/fentry/fexit mechanisms introduced
> > recently. There is no user-space API to get this info and e.g. bpftool
> > can only show all BPF programs but can't show if program A replaces a
> > function in program B.
> 
> IIUC, bpftool misses features to show fireplace/fentry/fexit relations? 
> I think we should enable that in bpftool. 

No, the main part in the comment is "there is no user-space API", i.e.
to my best knowledge kernel currently can't provide this info, bpftool
was just an example of one of the most well known users of BPF API.

Specifically everything-trampoline or attach_prog_fd (or corresponding
prog id) / attach_btf_id passed at loading time are not available to
user-space.

I believe there will be many things like this that can be expensive to
expose to user space via proper kernel API but are still useful to see
in user space. That's the point of this drgn script.


> > 
> > The name bpf.py is not super authentic. I'm open to better options.
> 
> Maybe call it bpftool.py? Or bpfshow.py?

bpftool.py may cause confustion with the genuine bpftool so I'd avoid
it, but bpfshow.py looks fine.


-- 
Andrey Ignatov

  reply	other threads:[~2020-02-27 17:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27  2:32 [PATCH bpf-next] bpf: Add drgn script to list progs/maps Andrey Ignatov
2020-02-27  5:45 ` Song Liu
2020-02-27 17:01   ` Andrey Ignatov [this message]
2020-02-27  6:27 ` Andrii Nakryiko
2020-02-27 17:38   ` Andrey Ignatov
2020-02-27 18:01 ` Stanislav Fomichev
2020-02-27 18:26   ` Andrey Ignatov
2020-02-27 21:11     ` Daniel Borkmann
2020-02-27 21:32       ` Daniel Borkmann
2020-02-27 22:19         ` Omar Sandoval
2020-02-28 20:11           ` Andrey Ignatov
2020-02-28 21:29             ` Andrey Ignatov
2020-02-28 12:51 ` Quentin Monnet
2020-02-28 20:15   ` Andrey Ignatov

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=20200227170103.GA29488@rdna-mbp \
    --to=rdna@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=osandov@fb.com \
    --cc=songliubraving@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