original_kernel/tools/bpf/bpftool
Daniel Borkmann bec981a4ad bpftool: Extend net dump with netkit progs
Add support to dump BPF programs on netkit via bpftool. This includes both
the BPF link and attach ops programs. Dumped information contain the attach
location, function entry name, program ID and link ID when applicable.

Example with tc BPF link:

  # ./bpftool net
  xdp:

  tc:
  nk1(22) netkit/peer tc1 prog_id 43 link_id 12

  [...]

Example with json dump:

  # ./bpftool net --json | jq
  [
    {
      "xdp": [],
      "tc": [
        {
          "devname": "nk1",
          "ifindex": 18,
          "kind": "netkit/primary",
          "name": "tc1",
          "prog_id": 29,
          "prog_flags": [],
          "link_id": 8,
          "link_flags": []
        }
      ],
      "flow_dissector": [],
      "netfilter": []
    }
  ]

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20231024214904.29825-6-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-10-24 16:07:32 -07:00
..
Documentation bpftool: Extend net dump with netkit progs 2023-10-24 16:07:32 -07:00
bash-completion bpftool: Add support for cgroup unix socket address hooks 2023-10-11 17:27:55 -07:00
skeleton bpftool: Use a local bpf_perf_event_value to fix accessing its fields 2023-07-10 15:29:21 -07:00
.gitignore
Makefile
btf.c
btf_dumper.c bpftool: Fix printing of pointer value 2023-10-19 16:29:36 +02:00
cfg.c
cfg.h
cgroup.c bpftool: Add support for cgroup unix socket address hooks 2023-10-11 17:27:55 -07:00
common.c
feature.c bpftool: Use "fallthrough;" keyword instead of comments 2023-07-12 23:50:11 +02:00
gen.c bpftool: Align bpf_load_and_run_opts insns and data 2023-10-09 09:36:51 -07:00
iter.c
jit_disasm.c
json_writer.c
json_writer.h
link.c bpftool: Implement link show support for netkit 2023-10-24 16:07:24 -07:00
main.c
main.h
map.c
map_perf_ring.c
net.c bpftool: Extend net dump with netkit progs 2023-10-24 16:07:32 -07:00
netlink_dumper.c
netlink_dumper.h bpftool: Extend net dump with tcx progs 2023-07-19 10:07:28 -07:00
perf.c bpftool: fix perf help message 2023-08-11 20:54:29 -07:00
pids.c
prog.c bpftool: Add support for cgroup unix socket address hooks 2023-10-11 17:27:55 -07:00
struct_ops.c bpftool: Wrap struct_ops dump in an array 2023-10-19 16:30:15 +02:00
tracelog.c
xlated_dumper.c bpftool: Dump the kernel symbol's module name 2023-07-11 20:07:50 -07:00
xlated_dumper.h bpftool: Dump the kernel symbol's module name 2023-07-11 20:07:50 -07:00