On Fri, Jan 11, 2008 at 04:39:25PM -0800, Roman Shaposhnik wrote: > On Sat, 2008-01-12 at 11:21 +1100, Sven Dowideit wrote: > > excellent stuff Andy! > > > > To start with the obvious :) > > > > Due to the lack of ustack helper, I am hoping to add a stack probe > > Two things: first of all DTrace could really benefit from a > general purpose mechanism of hooking up custom stack helpers > with the rest of the system. Frankly, the way jstack is done > doesn't strike me as too generic a mechanism.
Do you actually understand how it's implemented? It's actually quite general -- witness the presence of ustack helpers for both Python and PHP. (Indeed, the underlying mechanism is _so_ general that for some time we weren't sure if we had fallen prey to false generality.) The problem -- such as it is -- is not the lack of generality, it's that they are brutally difficult to write, in large part because the problem that ustack helpers are trying to solve is a brutally difficult problem. (Most VMs are not prepared to perform stack introspection in an arbitrary context.) > Second, I would like to encourage those who do DTrace integration > into Perl to take a look at what JavaScript is doing. They don't > have a custom stack helper either but the set of probes they offer > makes stack synthesis a trivial (albeit costly) matter. While the JavaScript approach is better than nothing, it is _not_ preferable to the ustack approach -- but a JavaScript ustack helper is prohibitively difficult at the moment because the information required simply doesn't exist when it's needed. So, Perl folks: if you can do it, a ustack helper is the way to go. It's brutal, but the payoff is substantial, as it will be much easier to connect misbehaving Perl to the symptoms of that misbehavior elsewhere in the system. If you're interested in seeing a demo of this, check out John Levon's blog on the Python ustack helper that he implemented: http://blogs.sun.com/levon/entry/python_and_dtrace_in_build And my description (and video) of demonstrating John's outstanding work at Google: http://blogs.sun.com/bmc/entry/dtrace_at_google - Bryan -------------------------------------------------------------------------- Bryan Cantrill, Sun Microsystems FishWorks. http://blogs.sun.com/bmc