]> 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)
commite06222adc5b211e0c50cb79c57d65492e1f92472
tree2305cd907b66788820d35647f7ef39392550319a
parent16ea2f02cd368faf648c9759784c3cc7c7e48e9b
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