bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] bpftool: Add struct_ops support
@ 2020-03-16  0:55 Martin KaFai Lau
  2020-03-16  0:56 ` [PATCH bpf-next 1/4] bpftool: Print the enum's name instead of value Martin KaFai Lau
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Martin KaFai Lau @ 2020-03-16  0:55 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Daniel Borkmann, kernel-team, netdev

This set adds "struct_ops" support to bpftool.

The first two patches improve the btf_dumper in bpftool.
Patch 1: print the enum's name (if it is found) instead of the
         enum's value.
Patch 2: print a char[] as a string if all characters are printable.

"struct_ops" stores the prog_id in a func ptr.
Instead of printing a prog_id,
patch 3 adds an option to btf_dumper to allow a func ptr's value
to be printed with the full func_proto info and the prog_name.

Patch 4 implements the "struct_ops" bpftool command.

Martin KaFai Lau (4):
  bpftool: Print the enum's name instead of value
  bpftool: Print as a string for char array
  bpftool: Translate prog_id to its bpf prog_name
  bpftool: Add struct_ops support

 .../Documentation/bpftool-struct_ops.rst      | 106 ++++
 tools/bpf/bpftool/bash-completion/bpftool     |  28 +
 tools/bpf/bpftool/btf_dumper.c                | 194 +++++-
 tools/bpf/bpftool/main.c                      |   3 +-
 tools/bpf/bpftool/main.h                      |   2 +
 tools/bpf/bpftool/struct_ops.c                | 595 ++++++++++++++++++
 6 files changed, 912 insertions(+), 16 deletions(-)
 create mode 100644 tools/bpf/bpftool/Documentation/bpftool-struct_ops.rst
 create mode 100644 tools/bpf/bpftool/struct_ops.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-03-17 21:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16  0:55 [PATCH bpf-next 0/4] bpftool: Add struct_ops support Martin KaFai Lau
2020-03-16  0:56 ` [PATCH bpf-next 1/4] bpftool: Print the enum's name instead of value Martin KaFai Lau
2020-03-17 20:03   ` Andrii Nakryiko
2020-03-16  0:56 ` [PATCH bpf-next 2/4] bpftool: Print as a string for char array Martin KaFai Lau
2020-03-17 20:08   ` Andrii Nakryiko
2020-03-17 21:03     ` Martin KaFai Lau
2020-03-16  0:56 ` [PATCH bpf-next 3/4] bpftool: Translate prog_id to its bpf prog_name Martin KaFai Lau
2020-03-16  0:56 ` [PATCH bpf-next 4/4] bpftool: Add struct_ops support Martin KaFai Lau
2020-03-16 11:54   ` Quentin Monnet
2020-03-17  0:24     ` Martin KaFai Lau
2020-03-17  0:57       ` Martin KaFai Lau
2020-03-17  9:25         ` Quentin Monnet
2020-03-16 11:54 ` [PATCH bpf-next 0/4] " Quentin Monnet

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).