[ccan] Module dependency graph

Joseph Adams joeyadams3.14159 at gmail.com
Mon Jan 17 18:54:10 EST 2011


I wrote a little Perl script for producing a graph of CCAN module
dependencies with Graphviz.  Except for a little tweak needed to get
the tools/ccan_depends --compile flag to work, the attached patch
simply drops the script in the tools directory.  I didn't add any
makefile magic.

Usage (requires Graphviz; will take several seconds):

tools/module-dep-graph.pl | dot -Tpng > out.png && xdg-open out.png

Result:

http://tinyurl.com/6jk4cbo

Better yet, use the Graphviz tred (transitive reduction) tool to
remove redundant edges (such as wwviaudio -> libvorbis):

tools/module-dep-graph.pl | tred | dot -Tpng > out.png && xdg-open out.png

Result:

http://tinyurl.com/64s9r9d

The second picture is much easier to understand.

Looking at the graph begs the question: should CCAN be a collection of
snippets that are easy to use in isolation?  Or should it be a
framework, as the dependency graph suggests it currently is?  Although
the former would be convenient for users, it would lead to maintenance
difficulties (imagine having to fix a bug in multiple copies of ilog).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module-dep-graph.patch
Type: text/x-patch
Size: 3249 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20110117/3eb21f0c/attachment.bin>


More information about the ccan mailing list