P@ Sunglasses

« Re: Todd Fast: HOWTO... | Main | Why is Google intere... »

20050125 e martë janar 25, 2005

Sun opens 82678 lines of C code today: have a good read!

Today Sun started the open sourcing of Solaris by releasing the source code for DTrace. I'm a java guy, with a little experience in C and C++, but not familiar at all with UNIX kernel engineering, so I guess this code will be way off my head. But I decided to download it and take a quick look at it.

The OpenSolaris site has a neat simple design, with a list of blogs on the right, but no RSS feed yet. I hope they'll add that soon.

The download is quick, and I was very happily surprised that you don't have any form to fill out, or email/password to remember to get to it: click on the link and download.

The code?

find . -name '*.c' | xargs wc
...
 82678  272892 2111307 total

and

find . -name '*.[c|h]' | xargs wc
...
   91380  322081 2468438 total

So it's 82 kloc (Kilo Lines Of Code) of C code, plus 9 kloc of headers. I guess I need to finish Diomidis Spinellis' excellent Code Reading: The Open Source Perspective which sits in my pile since a while before even starting looking at it!

For all you C people: happy code reading.

( Jan 25 2005, 02:25:31 MD PST ) Permalink Comments [2] Chat about it Technorati cosmos Tagsurf It

Comments:

Hey -- you forgot the assembly! ;)
% wc -l `find usr -name \*.s`        
      32 usr/src/lib/libdtrace/i386/dt_asmsubr.s
      31 usr/src/lib/libdtrace/sparc/dt_asmsubr.s
     427 usr/src/uts/intel/dtrace/dtrace_asm.s
     738 usr/src/uts/sparc/dtrace/dtrace_asm.s
    1228 total
%
Admittedly, catering to even smaller demographic...

Posted by Bryan Cantrill on janar 25, 2005 at 03:10 MD PST #

Don't let the code's size overwhelm you. First compile and install it. Then try to make a simple change, to get a feeling of it. At that point you are ready to embark on a larger project. An important aspect of code reading is that in most cases you don't need to do a lot of it. This is why it works! Diomidis

Posted by Diomidis Spinellis on janar 30, 2005 at 11:40 MD PST #

Post a Comment:

Comments are closed for this entry.

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.