On Wed, 2008-06-04 at 13:07 -0400, Chip Bennett wrote: > > > The reason for no looping is ... loop became long, or even worse, > > > infinite, your system would be hosed. > > > > > > The reason for no if/else construct is because each probe clause must > > > produce a fixed length trace record. > > > > I always thought that it's deliberate way of torturing us, the users :) > > > > Amen to that! Am I an experienced user of DTrace who understands why we > don't need flow control, or am I a lemming rationalizing what I've been > taught to live with? > To quote the USENIX paper > (http://www.sun.com/bigadmin/content/dtrace/dtrace_usenix.pdf), "To prevent > DIF from inducing an infinite loop in probe context, only forward > branches are permitted. This safety provision may seem draconian — it > eliminates loops altogether — but in practice we have not discovered it to > present a serious limitation."
I believe there's a curious gap to be potentially exploited here: it seems that DIF object code is capable of slightly more than the language translator offers up front. One idea that has been mentioned here is to have a translator that would morph if-then-else into a sequence of probes. Another idea could be to allow loops with a constant boundary (via loop unrolling of course). I'm currently doing things like these via M4, but I have an unsettling feeling that D++ could be called for ;-) Thanks, Roman. _______________________________________________ dtrace-discuss mailing list dtrace-discuss@opensolaris.org