Skip to contentSkip to conversation

include dependency graph script

ANNOUNCE Arnaldo Carvalho de Melo 2 participants 3 messages Dec 30, 2001

lore
Share & tools
lore
#0 lore raw

Hi,

For the people that like me, Daniel Phillips and Manfred Spraul are
working on pruning the include dependencies in the kernel sources I made a simple script to make a graphviz file to plot the dependencies in a nice graphic, its availabe at:

http://www.kernel.org/pub/linux/kernel/people/acme/hviz

usage:

hviz include/net/sock.h 2 | dotty -

or

hviz include/net/sock.h 2 > /tmp/sock.dot
dot -Tps /tmp/sock.dot > /tmp/sock.ps
gv /tmp/sock.ps

Yes, one can do that with pipes and not with the temporary sock.dot file, but this is just so that you can see how the intermediate graphviz file look like.

this example is also available at:

http://www.kernel.org/pub/linux/kernel/people/acme/sock_include_deps.ps

So that people can see how it looks :-)

the graphviz package is available at:
http://www.research.att.com/sw/tools/graphviz/

Comments and patches for the script are welcome.

- Arnaldo

#1 lore raw
Quoted 6 lines · Arnaldo Carvalho de Melo

For the people that like me, Daniel Phillips and Manfred Spraul are
working on pruning the include dependencies in the kernel sources I made a simple script to make a graphviz file to plot the dependencies in a nice graphic, its availabe at:

http://www.kernel.org/pub/linux/kernel/people/acme/hviz

I suggest that you prune linux/config.h and autoconf.h from all graphs. The dependency system does not depend directly on those files, instead it depends on individual config options.

It makes more sense to list the individual config options that an include file depends on, see the code in scripts/mkdep.c. Even then it would be better to suppress the config options by default and only list them when requested.

#2 lore raw
In reply to Arnaldo Carvalho de Melo

Em Sun, Dec 30, 2001 at 02:55:30PM +1100, Keith Owens escreveu:

Quoted 9 lines
Quoted 6 lines · Arnaldo Carvalho de Melo

For the people that like me, Daniel Phillips and Manfred Spraul are
working on pruning the include dependencies in the kernel sources I made a simple script to make a graphviz file to plot the dependencies in a nice graphic, its available at:

http://www.kernel.org/pub/linux/kernel/people/acme/hviz

Quoted 8 lines

I suggest that you prune linux/config.h and autoconf.h from all graphs. The dependency system does not depend directly on those files, instead it depends on individual config options.

It makes more sense to list the individual config options that an include file depends on, see the code in scripts/mkdep.c. Even then it would be better to suppress the config options by default and only list them when requested.

Thanks for the comments, this was a quick hack, I'll probably rewrite it in python gleaning code from a tool we have here in Conectiva to prune/analise the RPM packages dependency hell.

- Arnaldo