netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH RFC 0/3] bpf: show attached name for progs without btf name
Date: Fri, 18 Feb 2022 09:56:09 +0000	[thread overview]
Message-ID: <20220218095612.52082-1-laoar.shao@gmail.com> (raw)

With progs.debug we can get the attached name of the bpf prog which is
attached to a kernel function. But we can't get bpf progs which are
attached to others, like a cgroup, sockmap and etc. This patchset means
to extend the attached name to other types.

The member attach_func_name in struct bpf_prog_aux is renamed to
attach_name in patch #1, to avoid possible confusion. Then in patch #2
and #3 I extend the attached name to bpf progs which are attached to a
cgroup or a sockmap. If this solution is acceptable, I will extend it to
other attach types in the next step.

Yafang Shao (3):
  bpf: rename attach_func_name to attach_name
  bpf: set attached cgroup name in attach_name
  bpf: set attached sockmap id in attach_name

 include/linux/bpf.h                           |   3 +-
 kernel/bpf/bpf_iter.c                         |   2 +-
 kernel/bpf/bpf_lsm.c                          |   2 +-
 kernel/bpf/btf.c                              |   2 +-
 kernel/bpf/cgroup.c                           |   8 +
 kernel/bpf/preload/iterators/iterators.bpf.c  |   4 +-
 kernel/bpf/preload/iterators/iterators.skel.h | 488 +++++++++---------
 kernel/bpf/syscall.c                          |   2 +-
 kernel/bpf/verifier.c                         |   4 +-
 net/core/sock_map.c                           |   8 +-
 10 files changed, 276 insertions(+), 247 deletions(-)

-- 
2.17.1


             reply	other threads:[~2022-02-18  9:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18  9:56 Yafang Shao [this message]
2022-02-18  9:56 ` [PATCH RFC 1/3] bpf: rename attach_func_name to attach_name Yafang Shao
2022-02-18  9:56 ` [PATCH RFC 2/3] bpf: set attached cgroup name in attach_name Yafang Shao
2022-02-19 18:27   ` Alexei Starovoitov
2022-02-20 14:17     ` Yafang Shao
2022-02-20 20:59       ` Alexei Starovoitov
2022-02-21  2:33         ` Yafang Shao
2022-02-21 14:26         ` Yafang Shao
2022-02-22  4:30           ` Alexei Starovoitov
2022-02-22  8:34             ` Yafang Shao
2022-02-18  9:56 ` [PATCH RFC 3/3] bpf: set attached sockmap id " Yafang Shao

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=20220218095612.52082-1-laoar.shao@gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=netdev@vger.kernel.org \
    --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).