]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: generate .dot graph from CFG information
authorJiong Wang <jiong.wang@netronome.com>
Fri, 2 Mar 2018 02:01:21 +0000 (18:01 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 2 Mar 2018 02:29:49 +0000 (18:29 -0800)
commit1782dac4d14f7d0aacb6d58708143a907ce15d80
tree2305cd907b66788820d35647f7ef39392550319a
parent391a7ea2302364623e359492decd458f5063128a
tools: bpftool: generate .dot graph from CFG information

This patch let bpftool print .dot graph file into stdout.

This graph is generated by the following steps:

  - iterate through the function list.
  - generate basic-block(BB) definition for each BB in the function.
  - draw out edges to connect BBs.

This patch is the initial support, the layout and decoration of the .dot
graph could be improved.

Also, it will be useful if we could visualize some performance data from
static analysis.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/cfg.c
tools/bpf/bpftool/xlated_dumper.c
tools/bpf/bpftool/xlated_dumper.h