All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/7] bpftool: Add inline annotations when dumping program CFGs
@ 2023-04-05 13:21 Quentin Monnet
  2023-04-05 13:21 ` [PATCH bpf-next v3 1/7] bpftool: Fix documentation about line info display for prog dumps Quentin Monnet
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Quentin Monnet @ 2023-04-05 13:21 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, bpf,
	Eduard Zingerman, Quentin Monnet

This set contains some improvements for bpftool's "visual" program dump
option, which produces the control flow graph in a DOT format. The main
objective is to add support for inline annotations on such graphs, so that
we can have the C source code for the program showing up alongside the
instructions, when available. The last commits also make it possible to
display the line numbers or the bare opcodes in the graph, as supported by
regular program dumps.

v3:
- Fixed formatting of DOT graph: escape spaces, and remove indent that
  would cause some unwanted spaces to show up in the resulting graph.
- Don't print line information if the record is empty.
- Add '<' and ' ' to the list of escaped characters for generting the
  DOT graph.
- Truncate long file paths, use shorter field names ("line", "col") for
  code location information in the graph, add missing separator space.
- Add a commit to return an error if JSON output and CFG are both
  required.
- Add a drive-by, clean up commit for bash completion (avoid unnecessary
  calls to _bpftool_once_attr()).

v2: Replace fputc(..., stdout) with putchar(...) in dotlabel_puts().

Quentin Monnet (7):
  bpftool: Fix documentation about line info display for prog dumps
  bpftool: Fix bug for long instructions in program CFG dumps
  bpftool: Support inline annotations when dumping the CFG of a program
  bpftool: Return an error on prog dumps if both CFG and JSON are
    required
  bpftool: Support "opcodes", "linum", "visual" simultaneously
  bpftool: Support printing opcodes and source file references in CFG
  bpftool: Clean up _bpftool_once_attr() calls in bash completion

 .../bpftool/Documentation/bpftool-prog.rst    | 18 ++--
 tools/bpf/bpftool/bash-completion/bpftool     | 42 +++++-----
 tools/bpf/bpftool/btf_dumper.c                | 83 +++++++++++++++++++
 tools/bpf/bpftool/cfg.c                       | 29 ++++---
 tools/bpf/bpftool/cfg.h                       |  5 +-
 tools/bpf/bpftool/main.h                      |  2 +
 tools/bpf/bpftool/prog.c                      | 78 ++++++++---------
 tools/bpf/bpftool/xlated_dumper.c             | 54 +++++++++++-
 tools/bpf/bpftool/xlated_dumper.h             |  3 +-
 9 files changed, 226 insertions(+), 88 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2023-04-12 13:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05 13:21 [PATCH bpf-next v3 0/7] bpftool: Add inline annotations when dumping program CFGs Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 1/7] bpftool: Fix documentation about line info display for prog dumps Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 2/7] bpftool: Fix bug for long instructions in program CFG dumps Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 3/7] bpftool: Support inline annotations when dumping the CFG of a program Quentin Monnet
2023-04-12  6:04   ` Sven Schnelle
2023-04-12 12:05     ` Quentin Monnet
2023-04-12 12:26       ` Sven Schnelle
2023-04-12 13:29         ` Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 4/7] bpftool: Return an error on prog dumps if both CFG and JSON are required Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 5/7] bpftool: Support "opcodes", "linum", "visual" simultaneously Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 6/7] bpftool: Support printing opcodes and source file references in CFG Quentin Monnet
2023-04-05 13:21 ` [PATCH bpf-next v3 7/7] bpftool: Clean up _bpftool_once_attr() calls in bash completion Quentin Monnet
2023-04-06  4:30 ` [PATCH bpf-next v3 0/7] bpftool: Add inline annotations when dumping program CFGs patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.