Skip to content

RFC bpf: show attached name for progs without btf name

Yafang Shao bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: rename attach_func_name to attach_nameinclude/linux/bpf.h kernel/bpf/bpf_iter.c kernel/bpf/bpf_lsm.c +5 more+261 -2460 replies
2/3bpf: set attached cgroup name in attach_namekernel/bpf/cgroup.c+8 -07 replies
3/3bpf: set attached sockmap id in attach_namenet/core/sock_map.c+7 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/3] bpf: show attached name for progs without btf name

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(-)
Signature · 1 line
2.17.1