Details...

The process is way suboptimal speedwise, and contains some ugly hacks. It goes like so:

  1. For each "ring" (lib/mm/kernel/init/ipc, net/fs, arch & drivers):
    1. For each .c file from the kernel tree:
      1. Use analyze_file.pl to dump out the functions into separate files.
      2. Eliminate functions smaller than a certain size.
      3. Use classify_function.sh to classify the functions into STATIC, INDIRECT (called through pointer) or NONSTATIC.
  2. Then use classify_nonstatics.sh to classify all the NONSTATIC functions into EXPORTED (exported to modules using EXPORT_SYMBOL), INDIRECT (called through pointer) or NORMAL. This bunches the function names together in a big regexp, greps through the kernel sources, and then greps through the result of that for each function.
  3. Then we enter stage II: creating the Postscript. We create an image/ subdirectory.
  4. First thing we do in run gen_makefile.sh to generate a Makefile in the image/ dir, now we know what functions exist.
  5. Then we cd into the image/ dir and do a make. This does the following:
    1. We render all the functions, using analyze_function.lex, and feed the output of this into data2ps.c, which does the actual rendering.
    2. The functions in each file are labelled and combined back into a PostScript image of the whole file, using conglomerate_functions.sh, which puts a dashed bounding box and label on each function, then calls draw_arrangement.c to arrange them into a glob, which gets a solid bounding box and the filename attached.
    3. The files are then rendered into sectors, according to the ring, using draw_arrangement.c again. The inner ring has all the files in the ipc, kernel, lib, mm and init dirs all piled together. The second ring has two segments: the fs/ segment and the net/ segment. The third ring has one segment per architecture, and the final ring has all the drivers piled together. The layout algorithm is inner to outer, smallest to largest, with an iterative spacing increase if there is too much gap in the outer ring.
    4. Rings II and III, which have multiple sectors, are assembled using rotary_arrange.sh.
    5. Once the rings are done, we draw the black outline demarking them, with the labels on it.
    6. Then we paste the rings together with the key, the title, logo, author and the outline generated above, to give image/image.ps.
  6. Finally, we create a symlink called "image.ps" into the image directory.
  7. To create a nicely bounded PS compliant image, the "posterize" shell script can be used (and trivially hacked), which uses the bounding box information at the bottom of the PostScript file (I keep this uptodate through all the steps).