Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Clean up the #include mess a little.

From: Ants Aasma <ants(dot)aasma(at)eesti(dot)ee>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Clean up the #include mess a little.
Date: 2011-09-06 15:40:04
Message-ID: CA+CSw_swDoToduoEkt8GSi0dvMwDOYei--zATg_VrZedZpgZ1A@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Mon, Sep 5, 2011 at 4:55 PM, Greg Stark <stark(at)mit(dot)edu> wrote:
> What I wouldn't mind seeing is a graph of all includes and what they
> include. This might help figure out what layering violations there are
> like the one that caused this mess. I think I've seen tools to do this
> already somewhere.

I whipped together a quick Python script to do this. Attached is the
Python script (requires pydot) and the result of running it on includes/.
I didn't attach the png version of the output because it was 7MB.

If rendering all includes at once doesn't give a good overview it can
also select a subset through traversing dependencies. For example:
render_includes.py -i include/ \
  --select="storage/spin.h+*,access/xlog.h+*" output.png

This will render everything that directly or indirectly depends  on those
two headers. See --help for details.

--
Ants Aasma

Attachment: render_includes.py
Description: text/x-python (4.2 KB)
Attachment: pg_includes.svgz
Description: image/svg+xml-compressed (93.8 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2011-09-06 16:51:07
Subject: Re: Redundant bitmap index scans on smallint column
Previous:From: Tom LaneDate: 2011-09-06 15:19:45
Subject: Re: Couple document fixes

pgsql-committers by date

Next:From: Tom LaneDate: 2011-09-06 16:16:37
Subject: pgsql: Update type-conversion documentation for long-ago changes.
Previous:From: Bruce MomjianDate: 2011-09-06 15:09:07
Subject: pgsql: Properly document semphore requirements by accounting forworker

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group