aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/xlated_dumper.h
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@netronome.com>2018-03-01 18:01:21 -0800
committerAlexei Starovoitov <ast@kernel.org>2018-03-01 18:29:49 -0800
commitefcef17a6d6575dacca22bce69e139354c5a2170 (patch)
tree2305cd907b66788820d35647f7ef39392550319a /tools/bpf/bpftool/xlated_dumper.h
parenttools: bpftool: add out edges for each basic-block (diff)
downloadlinux-dev-efcef17a6d6575dacca22bce69e139354c5a2170.tar.xz
linux-dev-efcef17a6d6575dacca22bce69e139354c5a2170.zip
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>
Diffstat (limited to '')
-rw-r--r--tools/bpf/bpftool/xlated_dumper.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/xlated_dumper.h b/tools/bpf/bpftool/xlated_dumper.h
index 208285f9ab70..51c935d38ae2 100644
--- a/tools/bpf/bpftool/xlated_dumper.h
+++ b/tools/bpf/bpftool/xlated_dumper.h
@@ -58,5 +58,7 @@ void dump_xlated_json(struct dump_data *dd, void *buf, unsigned int len,
bool opcodes);
void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len,
bool opcodes);
+void dump_xlated_for_graph(struct dump_data *dd, void *buf, void *buf_end,
+ unsigned int start_index);
#endif