Linux 2.4 Schematic Poster (Generated From Source!) 127
Dave Sifry writes: "Rusty Russell has posted the scripts that render a function call graph of all of the .c files in the Linux kernel. Each file is graphically represented and named, and function calls are graphically represented inside of each source file. The end result is a 180MB vector PostScript file. You can get the source code and then render it yourself, or if you just want to get the big finished poster, send an e-mail to Linuxcare or contact EverythingLinux if you live down under. BTW, it took us about 5 hours to get that file to print at a print shop down at LWE - that much vector PostScript really tested the limits of their big printers!"
Re:What would be even cooler... (Score:1)
Re:What would be even cooler... (Score:1)
might be able to use the kernel profiling support for this.
Re:5 hours rendreing? Duh... (Score:1)
Re:wow (Score:1)
I'm not sure what you're running off of, but try being
Ooops. And wow, did that hurt!
Re:Could you imagine... (Score:1)
I was wondering what all that green pasta was at the supermarket....
--
Re:Detailed Explanation (Score:1)
Hi!
Well, look at analyze_function.lex, which does this breakdown; it's basically a line of length 1 per "statement" (the output of this is sent to data2ps, which randomly jitters the angle).
Hope that helps,
Rusty.
Re:Detailed Explanation (Score:1)
That would be wrong. It could be done in a 1/2 hour by using a much less naive system, and allowing it to be parallelized better.
I was optimizing for *my* time, not yours 8)
Rusty.
Re:Problems with the Makefile (Score:1)
The PROPER solution to this problem
SHELL=/usr/local/bin/bash
(or wherever your bash resides)
that will make make use the shell provided.
I knew this rung a bell... (Score:1)
Re:What? (Score:1)
...the horrors...
Re:Equivalent program for C++ class structures (Score:1)
Try Together. www.togethersoft.com
I don't use their product, but it does what you want.
Oh, and they charge for it. That's business for you.
Re:tempfile (Score:1)
Now I'm stuck on "Runtime error (func=(main), adr=23): Divide by zero"
If you would like to take this discussion to email, remove "nispam." from my email address..
Geoff
A Hack to the LGP Scripts to Print Any Program (Score:1)
Basically, it works just like LGP except that it 1. Works with a single directory instead of many, 2. Doesn't put in Tux, the key, the title, or anything, and 3. Includes a slight more documentation than the original, though not that much more.
Everyone wanted it, it's now something you can check out and download and play with. Anybody who programs for a living will sneer and snicker at my efforts, but that's life, right? At least I put my efforts up for others. Enjoy.
- Jason Scott
Amateur Code Guy
Re:tempfile (Score:1)
It would be less overhead to use the
$$ facility.
TEMPFILE=/yourfastdisk/tmp$$
GPL and printed Posters? (Score:1)
adrien cater
boring.ch [boring.ch]
Re:GPL and printed Posters? (Score:1)
adrien cater
boring.ch [boring.ch]
Re:Equivalent program for C++ class structures (Score:1)
Rational Rose will do this. It is used for planning a system at the class level (and then generating the class files) or reverse-engineering existing classes into a UML diagram.
Re:Could you imagine... (Score:1)
Re:5 hours rendreing? Duh... (Score:1)
Re:You can make the poster faster if... (Score:1)
I'm pretty sure this part can be done in 5-20 minutes on my machine by recoding the algorithm to use a join (using the join(1) command) and am testing that now, but don't unfortunately have a bunch of time to spend on it.
I'll put a patch, not guaranteed to work, at http://puffin.external.hp.com/~bame/ [hp.com], if anyone's interested, hopefully tomorrow. Or e-mail me if there's a better place to send this possibly broken patch (besides sending it to Rusty when it seems to be working well).
Re:Problems with the Makefile (Score:1)
Copying ring1 functions from kernel directory...
make: *** [image/ring1] Error 1
any ideas? looks like it is hanging on line 81 of the Makefile.
use LaTeX? want an online reference manager that
seems to be working on mandrake 7.2 (Score:1)
use LaTeX? want an online reference manager that
crapped out on mandrake 7.2 (Score:1)
use LaTeX? want an online reference manager that
Quarter gig? (Score:1)
Now if you're talking about a printer with 256MB, then that's something...
--
Patrick Doyle
Re:Awesome! (Score:1)
Any more information in the diagram--its arrangement into concentric circles and radial slices, for instance--was likely added manually (although I'm just guessing here).
Surely there are diagrams which capture the design abstractions of a system better than a call graph?
--
Patrick Doyle
Re:Could you imagine... (Score:1)
Linus is actually guilty of a fairly major logic error here. Just because he can fix a bug once in Linux doesn't instantly mean the whole source is understood by him, much less actually understood by anyone. You only have to look on Kernel Traffic to see there are still bugs in the 2.4.x kernel (has anyone actually found all the filesystem corruption bugs yet?) that no one is quite sure of the solution to - just none of them are showstoppers.
Nothing in Linus' speech takes anything from Win2k either - it is entirely possible that a similar bug could be found in Win2k and fixed in just as fast a time (ping of death was fixed in under 24 hours for example). That doesn't instantly mean the Win2k source is completely simple - it just means that one bug was fixed quickly.
If you read "Inside Windows 2000 - 3rd edition" you'll start to see that the guts of Win2k actually are fairly well separated, possibly even better than the current Linux kernel. There is a clean separation between most components of the executive and the kernel and if there was a plot printed, my guess would be that it would look more like meatballs than spaghetti - lots of tightly coupled chunks of code with well defined interfaces between them. On a project as large as Win2k there is simply no other way you can effectively work.
Kudos to Linus for fixing a bug in the 2.0 kernel so quickly, but I'm afraid there is just no logical step you can make to the statement that "No one understands NT".
Re:Could you imagine... (Score:1)
Actually, they aren't the ones I was talking about. They are the strawmen generally set up when people don't want to admit bugs that are actually there. Look at these links:
http://kt.linuxcare.com/kernel-traffic/kt20010202_ 105.epl#5 [linuxcare.com]
http://www.uwsg.indiana.edu/hypermail/linux/kernel /0102.0/0220.html [indiana.edu]
Maybe your 'summary' was really a strawman and the fact is that Linux is getting complex enough that no one person can fully understand it?
Re:Could you imagine... (Score:1)
The other fact is that it is relatively easy to get a high level view of how Win2k works (despite your unfounded rhetoric to the contrary). Read the book I mentioned in my original post.
I did (Score:1)
Re:What's next? Linus' DNA? (Score:1)
(re: the sig, in case you're wondering)
Re:european availability (Score:1)
Either make sure the main point of your message is how great Linux is or that Micro$oft (MUST use the dollar sign) really suck...
...or mention somewhere in your post that 'I know i'm going to get modded down for this but...'
Still, i'll probably get modded down for saying it...
(and never, never, try to be funny)
Re:What's next? Linus' DNA? (Score:1)
You may also want to clone Andy Tannenbaum. Now that's either funny or trolling... not sure which...
Re:Could you imagine... (Score:1)
Ummmmm... You misspelled "2 years" as "under 24 hours".
Ordinarily I don't bother with spelling corrections,
but this does totally change your post.
---CONFLICT!!---
Re:Is this useful for programmers? (Score:1)
The object investigator uses this db to provide an in-depth view of every single random thing within the operating system. It's quite useful when hacking on something that has a lot of interconnections to other parts of the system.
Of course, the debugger is fantastically sophisticated as well. It provides a similar level of functionality. Too bad the Unix people never paid attention to their betters. Maybe someday they'll learn, or someone will write an easily portable Lisp-based OS.
Re:european availability (Score:1)
Re:What's next? Linus' DNA? (Score:1)
Killing a Server 101 (Score:1)
Ha! This is the funniest post I've read all day. Must have taken all of 5 minutes for this server to die.
Re:Poster's **NOT** already available... (Score:1)
Mr. Gates (Score:1)
Re:Poster's already available... (Score:1)
Re:Could you imagine... (Score:1)
Re:Could you imagine... (Score:1)
1. Linus doesn't have to exhaust himself doing two jobs or feel obligated to the community as I'm certain he feels now. He would be free to loosen the reins a bit and relax.
2.I think companies would be more ready to move to Linux (isn't that our goal, world domination
I know that anyone could look at the kernel and make the appropriate adjustments but, Linus was bale to do it in under 48 hours. how long would the USPS have to wait if Linus was unavailable and they were forced to hunt down a competent coder to do the work that he could do in a short time. with a board available they would have multiple options and a list of names that they could be certain could fulfill their needs.
just imagine if linus had been unavailable. what if during the time he had taken a vaction to a deserted island with no net connection for a month in an effort to unwind. you may thin kthe USPS is slow but look at the volume they deal in. a week or a month of not being able to properly use my software and I start thinking "this is not the reliable easy to fix software i had heard it was. lets switch to solaris or *bsd."
do you understand what i mean? Linus if you're reading do you or are you so full of yourself that you don't care and think that there's nothing that could happen you couldn't fix in no time flat. if he's in a car crash and ends up in traction for a year kernel dev stops. If I'm a fortune 500 company that depends on kernel updates and new advances being implemented quickly i worry that there is no one to go to.
i think I've more than made my point. let the flamage begin.
Re:Poster's already available... (Score:1)
dopp
Re:Detailed Explanation (Score:1)
Very cool work - thanks ! Very Nasty Code - thanks !
Can you give us more of a description of *why* the code is doing, as opposed to *what* ? What are the deciding factors for the layout of the function blocks ? What about the colored lines within ? I know that forks represent code forks, but the curves ?
For example, I took a look at drivers/net/tokenring/olympic.c and it shows one function sprintf_info as a large block with a simple green spiral in it. No if/switch statements, so no forks in the line. Does the length of the line/spiral represent the length of the function ? I thought that was the size of the box
Need Input !
Possible enhancement - show partial call graphs, just within
Re:Detailed Explanation - Cut marks (Score:1)
Different issue now - the cut marks. I'm assuming you're supposed to cut at the lines pointed to by the arrows, right ? If you cut off the left and bottom margins, the bottom of the page still has the upper arrow of the cut-mark pointing down, and the right arrow pointing left at the left margin. These are within the viewable area.
Shouldn't the cut marks only have arrows in the discardable part of the image ?
Re:Equivalent program for C++ class structures (Score:1)
--
Re:Is this useful for programmers? (Score:1)
Actually, there is a tool that does something like this. "Application Mining Suite" by a french outfit called CAST. Sadly, they are very Microsoft focused in their endeavours.
CAST website: http://www.castsoftware.com/ [castsoftware.com]Re:What's next? Linus' DNA? (Score:1)
I don't think SMP would work with Linuses or Alans.
Could you imagine the power of a Beowulf cluster of Linus Clones?
You can make the poster faster if... (Score:1)
Re:{ question } (Score:1)
cool use for this! (Score:1)
Re:cool use for this! (Score:1)
Printing time (Score:1)
Reminds me of the Mandelbrot set and raytracing images I've seen written in .ps. As it takes a while to render those on my K6, I wonder what the
old printers at our college would think of them..
--
Re:Killing a Server 101 (Score:1)
Wow, good thing work has really big printers. (Score:1)
Re:5 hours rendreing? Duh... (Score:1)
A program change PS to a graphics format (like a virtual printer, substitutes *.bmp or *.xpm pixels for printer dots) would be handy -- does one exist?
(Does anyone want to make one?)
Changing any other (graphics) format would then be simple as [load] and [save-as] with any graphics editor.
Re:What's next? Linus' DNA? (Score:1)
Cloning Alan Cox would be a bad idea; though not as bad as cloning RMS .
You know they don't call it GNU/Linux for no reason..
--
ThinkGeek/Copyleft? (Score:2)
Alex Bischoff
---
Re:ThinkGeek/Copyleft? (Score:2)
Alex Bischoff
---
Equivalent program for C++ class structures (Score:2)
Re:What would be even cooler... (Score:2)
About as difficult as a debugger, I'd imagine...
Re:What would be even cooler... (Score:2)
Re:Poster's already available... (Score:2)
Solution for RH 6.2 Problem... (Score:2)
version that works with redhat 6.2 (Score:2)
use LaTeX? want an online reference manager that
patch for rh 6.2 (Score:2)
download patch here [pitt.edu]
use LaTeX? want an online reference manager that
and another (Score:2)
use LaTeX? want an online reference manager that
Is it live, or is it... (Score:2)
I dunno, the image just strikes me as sort of...
Re:Equivalent program for C++ class structures (Score:2)
Rational Rose will do this. It is used for planning a system at the class level (and then generating the class files) or reverse-engineering existing classes into a UML diagram.
Yup, and you can have it all for the low-low price of $2394 [rational.com]
Re:We badly need this for GCC... (Score:2)
We badly need this for GCC... (Score:2)
I've been looking at Doxygen to help document the guts of the new replacement libstdc++-v3 library. These scripts would also help, in a big way.
I very much want to run the code for the compiler itself through these scripts and doxygen.
Many people, over the last year-and-some-odd, have made good progress towards implementing a new back-end target in GCC: an XML generator for your code. Rather than creating assembly, GCC would create XML. (And you'd better damn well believe that the first thing we'd run through it would be the sources to the compiler itself! :-)
Re:Could you imagine... (Score:2)
Are you suggesting that Win2k is not just spaghetti, but something like the platonic ideal of spaghetti?
I can buy that.
Re:What? (Score:2)
Guido Van Rossum's brother apparently did some work (or worked for a company that
Kinda neat.
You can probably chase it down from python.org
Re:Could you imagine... (Score:2)
The kernel doesn't stop with out him. Most of the day to day development isnt done by Linus, it's don by the maintainers of the specific subsystems. Linus does organize final releases, but that isn't even soley his job. One of the late 2.2 kernels(17 I think) was actually released by Alan Cox before Linus gave it final blessing.
The bug mentioned here was fixed by Linus, but he is certainly not the only one capable of fixing it. He probably fixed it because he was the contact for that part of the kernel and he was the one who found the solution first. If he wasn't reached RedHat would have brought it to someone else.
If Linus was in a car accident, some slow down may occur in areas where Linus would normally be the standard contact, but other developers would take up the slack. It would be much like the head of the NT Executive team being in a car accident. A very valuable programmer(and human being) would be injured, but the project would go on without it. No one talks about the NT kernel team much though.
treke
Re:european availability (Score:2)
Do you actually read
Stupid fuckers moaning about how they are about to get modded down.
Learn to take a joke.
Why don't you just fucking kill yourself, and save the world the pain of suffering your presence any longer.
If i had to live life as you apparantly do, with no humor, and without the guts to even speak as myself (AC) then i probably would. Pitiful.
How about another thing to expect on
Re:What would be even cooler... (Score:2)
Also, why would it not work for kernel threads ? You could use one of the debugging tools.
Re:{ question } (Score:2)
[Opinion opinionAgreeingTo:
[[Thread currentThread] previousPost]];
5 hours rendreing? Duh... (Score:2)
I saw this in New York... (Score:2)
I saw this at Linux Expo (Score:3)
Could some one please mirror the
Re:{ question } (Score:3)
SELECT nickname + ' is a complete moron.'
FROM users
WHERE posting_style = 'half-assed pseudocode'
--Shoeboy
reminds me of the redhat annual report (Score:3)
if i could find the link on corporate-ir.net, i'd link to the web version of the report, but it looks like they've dropped it and are only distributing the 10K.
pity. a lot of people really dug that poster, and have it hanging in their offices. i know a lot of people at redhat have them in their cubes.
Re:{ question } (Score:3)
european availability (Score:3)
Awesome! (Score:3)
Congrats to Rusty for this, it couldn't have been easy...
rr (No relation :)
heres a mirror: (Score:3)
100% totally offtopic (Score:4)
Anyway, sorry about that, feel free to mod me down.
--Shoeboy
tempfile (Score:4)
Well. My guess is that tempfile just gives a temporary filename ready for use. So, the (not politically correct) fix would be a perl script called tempfile.
#!/usr/local/bin/perl
print "/tmp/",rand(100000);
Worked for me ! My poster is on the way.
Posters are useful to check students' coding style (Score:4)
Fo example:
--ricardo Estilo Dalí: muy bien estructurada u orientada a objetos. Impresionista: el hombre es un monstruo de la programación.
What's next? Linus' DNA? (Score:4)
"Send $24.95 to the human genome project for a printed copy of Linus Torvalds' complete genome! Straight from the sources! Only takes 2000 hours to render on an average Postscript printer."
Come to think of it, a clone of Linus would really speed up development, wouldn't it? Or would we have to clone Alan Cox too?
;-)
Could you imagine... (Score:4)
wow (Score:4)
Is this useful for programmers? (Score:4)
Of course, unless this actually helps you understand the code, and is better than pre-existing methods, why bother? Sure, it looks cool, but a similar representation of paths to local chinese restraunts may look as cool (you can take 5th st, or 15th st, represented as spikes off an oval, etc...)
If it really is an aid for comprehension, or even better, exposes structural flaws, then this is great! Let's make the FPS version, with a profiler coloring or texturizing (is that a word?) the environment, to show time taken in different subroutines (rooms?)
Anyway, cool idea, but lets give it a few months to see if it is just cool, or cool and useful.
Detailed Explanation (Score:5)
1) This does not generate a call graph. It is a static rendering of all the functions in the
2) Yes, the images correspond to the code: forks represent if and switch() statements, circles cover the code within them. Also, code with asm statements, inline, etc are `hairier' (look in the architectures). So, a big star is either a big switch or an if...else if...else if..... If it's inside a circle, there's a loop around it. Two circles inside each other: nested loops. etc.
3) Why PostScript? For the 2.3.18 one I wanted to learn about PNG, so I did it in PNG. But I wanted people to be able to print out copies at home on small printers, so I wanted something scalable: 1GB PNG was not the answer. So I learnt PostScript and changed over to that; the `posterize' shell script lets you make an NxN poster for printing (I recommend >= 6x6).
4) cannot find -lfl
You need flex installed (or use lex and change the Makefile).
5) shopt: command not found
Run bash2, or remove the line:
shopt -s nullglob; for f in $(KERNEL_DIR)/$$d/*.c; do \
And replace it with these two (don't miss the trailing \'s!):
for f in $(KERNEL_DIR)/$$d/*.c; do \
if [ "$f" = "$(KERNEL_DIR)/$$d/*.c" ]; then continue; fi \
6) tempfile: command not found
Change the two occurrances of this (classify_nonstatics.sh and conglomerate_functions.sh) to:
TMPFILE=`mktemp ${TMPDIR:-/tmp}/$$.XXXXXX`
Please give feedback for these, and any other bug reports to rusty at my linuxcare.com.au address, and I'll release 2.4.0a soon...
Thanks!
Rusty.
Fast Mirror (SunSITE dk) (Score:5)
It's hosted at SunSITE Denmark [sunsite.dk] as you see, which should have enough bandwidth.
And yes, it's very cool, and it's completely unreadable at that size & resolution
Re:Could you imagine... (Score:5)
I thought the most telling thing, though, was what Linus said two years ago at a documents show in Atlanta. He was in a panel discussion with a Microsoft Marketroid (and maddog and a Wall Street analyst) and the 'droid was going on about Microsoft's huge labs where they could replicate any problem known to man. Then Linus in a quiet voice told the story of how the U.S. Post Office (that's right, boys and girls, Uncle Sam runs LINUX) had a problem with the computers that run the bar code sprayers. They called Red Hat, Red Hat emailed Linus, who thought about it, vi'ed the appropriate source file, discovered the race condition, fixed it, sent it back, USPS recompiled, and it worked. Total time, 48 hours. Then he said something which caused complete silence in the room:
This poster is proof of the easy understandability of Linux.--
Software is like SEX: it's better when it's free.
-- Linus Torvalds
What? (Score:5)
Linux running on a LaserWriter, what a joke.
What would be even cooler... (Score:5)
I wonder how difficult that would be to implement ?
Heh! That's nothing (Score:5)
Re:5 hours rendreing? Duh... (Score:5)
Size of the file doesn't matter - each sequence of vectors is rendered separately, slapped on the bit map of the page, and on to the next one.
HPGL/2 will not help - the complexity of the primitives is the same. HP/GL and PostScript share the same rendering backend on some printers.
Most plotters nowdays are wide-format inkjets with the same raster backend as other printers. Old pen plotters can't physically do 700 vectors/sec. No way. More like 25. How about drawing the same thing for five days, switching depleted pens on the fly? (reminds me of the old days... where's the old trusty 7225?)