Tuesday 3 August 2010

DTrace: Why not if?

I dont understand the rationale for not supporting if-then-else
statements in DTrace. It leads to illegible code. I know
why while/for-loops are not supported, and I do wonder about the
syntax of probes - which preclude functions/macros from being
implemented too.


I think whats needed is a DTrace++ which extends the syntax whilst
maintaining the current virtual machine.


Just fixing some things I dont like (hangs/crashes the kernel).
Just found that doing this:


$ dtrace -n "io:::{ustack();}"

causes traced processes to be stuck on a SIGSTOP signal. Need to figure
out where this is coming from, and why.


I have temporarily disabled ustack() from doing anything useful - so
I can figure this out, and hope to restore it soon.


I am also contemplating how to generate function prototypes from the
kernel source so we can access typed arguments to kernel functions
(since we dont have a CTF ELF section in the kernel, we need some way
to get high level access to structures; still debugging translators).


On another note, I am realising that I need to use DTrace more as a real
user - its helping to find things that are broken or just not easily
implementable without low level kernel knowledge. E.g. timing a process
being blocked due to a task schedule is almost easy but we dont have
access to the arguments to deref the process (struct task_struct) easily.


So, all in all, lots of things to experiment with and move forward,
but reliability/dependability is a key goal for the short term.


Post created by CRiSP v10.0.2a-b5881


No comments:

Post a Comment