Has anybody considered adding a DTrace user space provider to the VM? This could be very helpful for debugging and profiling (at least on Mac; I don't know about DTrace for Linux). My man pages on OS X describe the same approach for adding probes to a C program as in http://blogs.sun.com/ahl/entry/user_land_tracing_gets_better Ruby, Java, Perl, PHP and others have such high-level providers. Cheers, Adrian ___________________ http://www.adrian-lienhard.ch/ |
On Tue, May 19, 2009 at 3:54 AM, Adrian Lienhard <[hidden email]> wrote:
Yes, but things like MethodWrappers can provide excellent visibility and the VM already has lots of introspective support for memory usage, garbage colleciton timings, context switch counts, etc. I don't see DTrace as that compelling. What do you see as the costs and benefits?
|
On May 19, 2009, at 17:54 , Eliot Miranda wrote: > On Tue, May 19, 2009 at 3:54 AM, Adrian Lienhard <[hidden email]> > wrote: > >> >> Has anybody considered adding a DTrace user space provider to the VM? >> >> This could be very helpful for debugging and profiling (at least on >> Mac; I >> don't know about DTrace for Linux). >> >> My man pages on OS X describe the same approach for adding probes >> to a C >> program as in http://blogs.sun.com/ahl/entry/user_land_tracing_gets_better >> >> Ruby, Java, Perl, PHP and others have such high-level providers. > > > Yes, but things like MethodWrappers can provide excellent visibility > and the > VM already has lots of introspective support for memory usage, garbage > colleciton timings, context switch counts, etc. I don't see DTrace > as that > compelling. What do you see as the costs and benefits? MethodWrappers and similar approaches cannot be used in a production system and they do not help to debug a blocked VM. Furthermore, image- level approaches have the drawback that they noticeably influence the behavior (e.g., by creating new objects). I had a few situations where this sort of logging could have saved me hours (or days). One example was the problem where Squeak would suddenly stop responding to web requests and hog the CPU but would get back into normal mode as soon as you wiggle the mouse [1]. I could eventually find the root cause by compiling a special VM with John's message tracer that can be activated by sending a signal. With DTrace I could have just written a simple D script and trace the production system when it got into this mood. DTrace probes are said to have a very low execution overhead if they are not active and hence could be added to the VM by default. Something else interesting may be that DTrace provides many predefined probes for system and library calls that may be useful to combine with higher-level Smalltalk probes. I just hacked a small prototype and this seems to work (Unix VM on OS X). Adrian [1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-July/119023.html > > > >> >> Cheers, >> Adrian >> ___________________ >> http://www.adrian-lienhard.ch/ >> |
Adrian Lienhard wrote: > I had a few situations where this sort of logging could have saved me > hours (or days). One example was the problem where Squeak would suddenly > stop responding to web requests and hog the CPU but would get back into > normal mode as soon as you wiggle the mouse [1]. I could eventually find > the root cause by compiling a special VM with John's message tracer that > can be activated by sending a signal. With DTrace I could have just > written a simple D script and trace the production system when it got > into this mood. What we do in our production environments is to hook up SIGUSR1 to a handler that dumps all the call stacks in the system. This has proven to be *the* ticket to debug everything from CPU hogging over tight GC spins to semaphore and Delay lockups. > DTrace probes are said to have a very low execution overhead if they are > not active and hence could be added to the VM by default. Something else > interesting may be that DTrace provides many predefined probes for > system and library calls that may be useful to combine with higher-level > Smalltalk probes. > > I just hacked a small prototype and this seems to work (Unix VM on OS X). Did you run benchmarks with and without the probes to see what the impact is? Cheers, - ndres |
Free forum by Nabble | Edit this page |