DTrace for Squeak?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

DTrace for Squeak?

Adrian Lienhard
 
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/
Reply | Threaded
Open this post in threaded view
|

Re: DTrace for Squeak?

Eliot Miranda-2
 


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?



Cheers,
Adrian
___________________
http://www.adrian-lienhard.ch/

Reply | Threaded
Open this post in threaded view
|

Re: DTrace for Squeak?

Adrian Lienhard
 

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/
>>

Reply | Threaded
Open this post in threaded view
|

Re: DTrace for Squeak?

Andreas.Raab
 
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