当前位置:   article > 正文

如何生成模块中的头文件引用关系图_模块调用关系图

模块调用关系图

背景

当拿到一个模块的代码,我们自然而然的想要生成了解代码中的模块调用关系。
那么下面的脚本就是生成了模块之间的调用关系,图示如下:
在这里插入图片描述

原理

使用dot画图
以上的图示,dot源文件如下:

digraph spdk {
    graph [
        rankdir = "LR"
        //splines=polyline
        overlap=false
    ];

    node [
        fontsize = "16"
        shape = "ellipse"
    ];

    edge [
    ];
    "acl" [
        label = "<head> acl\l|
            {|{
                <f2fs> f2fs.h\l|
                <xattr> xattr.h\l|
                <acl> acl.h\l|
            }}"
        shape = "record"
    ];

    "checkpoint" [
        label = "<head> checkpoint\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <segment> segment.h\l|
                <iostat> iostat.h\l|
            }}"
        shape = "record"
    ];

    "compress" [
        label = "<head> compress\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <segment> segment.h\l|
            }}"
        shape = "record"
    ];

    "data" [
        label = "<head> data\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <segment> segment.h\l|
                <iostat> iostat.h\l|
            }}"
        shape = "record"
    ];

    "debug" [
        label = "<head> debug\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <segment> segment.h\l|
                <gc> gc.h\l|
            }}"
        shape = "record"
    ];

    "dir" [
        label = "<head> dir\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <acl> acl.h\l|
                <xattr> xattr.h\l|
            }}"
        shape = "record"
    ];

    "extent_cache" [
        label = "<head> extent_cache\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
            }}"
        shape = "record"
    ];

    "file" [
        label = "<head> file\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <segment> segment.h\l|
                <xattr> xattr.h\l|
                <acl> acl.h\l|
                <gc> gc.h\l|
                <iostat> iostat.h\l|
            }}"
        shape = "record"
    ];

    "gc" [
        label = "<head> gc\l|
            {|{
                <f2fs> f2fs.h\l|
                <node1> node.h\l|
                <segment> segment.h\l|
                <gc> gc.h\l|
               
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/699436
推荐阅读
相关标签
  

闽ICP备14008679号