>I am writing a program to read the kernel data structures and draw graphics
>on performance, such as load, swap, page ...etc. Somehow, we don't run sar,
>so is there any book on how to calculate these data instead of reading
I'm falling out of my chair laughing......
Take it from one who KNOWS. No such book exists.
Any book on the internals of Unix (both the Berkeley and System 5
variants) will be helpful in understanding how the kernel does what it
does. It may also provide hints on what some internal variables are
used for. But much of the specifics are derived from one of three
1. reading kernel source code
2. studying include files in /usr/include/sys
3. trial and error (i.e.: guessing)
Obviously not everyone can do #1.
(primary author for "top", in case you're wondering)