Sunday, February 06, 2011

Pushing kar along

I updated KAR recently.

This follows my recent philosophy that code and bugs are the same thing, although I hope that each version squishes some bugs as well as introducing them.

Most of the bugs fixed this time were as a direct result of trying to use kar for real, generating graphs of system activity to answer question for users, developers, and management. In some cases, kar just gave up or gave the wrong data.

(A particularly insidious bug lies in the use of printf in C. You have to specify exactly the type and size of a variable. If the type you print and the actual storage type don't match, bad things can happen. Worse, different processor architectures behave in different ways. Printing a 64-bit value as 32-bit appears to work on an Opteron box, but fails miserably on a SPARC.)

One thing I'm actually doing is using kar's print subcommand to output the data, and then munging the data before feeding it into something like ploticus to do the actual plotting. The inbuilt chart support works well for predefined charts, but I often want something slightly different.

No comments: