2001-12-30 03:38:21

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [ANNOUNCE] include dependency graph script

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


2001-12-30 03:56:01

by Keith Owens

[permalink] [raw]
Subject: Re: [ANNOUNCE] include dependency graph script

On Sun, 30 Dec 2001 01:30:33 -0200,
Arnaldo Carvalho de Melo <[email protected]> wrote:
> 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.

2001-12-30 04:04:31

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [ANNOUNCE] include dependency graph script

Em Sun, Dec 30, 2001 at 02:55:30PM +1100, Keith Owens escreveu:
> On Sun, 30 Dec 2001 01:30:33 -0200,
> Arnaldo Carvalho de Melo <[email protected]> wrote:
> > 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
>
> 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