DTrace is open source!
Slashdot today points us to OpenSolaris, where you can now download the source for DTrace, Solaris’s super-cool tool for tracing pretty much anything you can think of. <p/>
The program interacts with the user using a compiled scripting language called “D”. This is a C-like language designed specifically for DTrace. The difference is that there are a lot of builtins, and a lot of hooks. The whole point of dtrace is that you can hook into almost any function of the operating system or another application and execute any D code at that point. The great thing is that you don’t pay for hooks you don’t use – the hooks are inserted into the executable when dtrace starts, and they are removed when it exits.<p/>
Apparently, there are like thirty thousand hooks that you can listen to. They’re in a hierarchical structure, which I don’t fully understand, but you can specify something like syscall::read:entry to trap on all read() syscalls. <p/>
D code runs in kernelspace, and it is error-checked at runtime so that you don’t accidentally crash your kernel with a bogus dtrace script.<p/>
Anyway, I think this is really cool, and it’s great that they’re open sourcing it. I’m probably going to try to get Solaris so I can fool with it… but I don’t know how much I will use it. I might not have time to do it, what with school and all.<p/>