Merge branch 'bpftool: Add inline annotations when dumping program CFGs'
authorAlexei Starovoitov <ast@kernel.org>
Thu, 6 Apr 2023 04:27:27 +0000 (21:27 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Apr 2023 04:27:28 +0000 (21:27 -0700)
commitc6ebae4ccc43aaf279e36bb9bbe627137d7e88e1
tree2fec7cffe9e8f41a97431a9a055f8f3543464d8d
parent5af607a861d43ffff830fc1890033e579ec44799
parent7319296855f1bac0e7fb003388f44ecbd4515102
Merge branch 'bpftool: Add inline annotations when dumping program CFGs'

Quentin Monnet says:

====================

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

Signed-off-by: Alexei Starovoitov <ast@kernel.org>