[squeak-dev] Tracing context switches

Eliot Miranda eliot.miranda at gmail.com
Thu Oct 8 08:21:22 UTC 2015

Hi Tobias,

    IMO the best way would be to create a special VM that added printing to the transferTi:from: method (IIRC).  It can't be done reliably at the image level given the current implementation.  For example, you could add tracing to suspend, resume, signal and wait by renaming the primutives and invoking them from methods with the old name that add tracing, e.g.

     self logResume.
      ^self primResume

but this a) isn't thread safe and b) misses context switches initiated by the VM, eg when a delay fires.

But doing it in the VM is safe and will catch all switches.  We can discuss further tomorrow.  It's a simple change and generating eg a new Stack VM should be straightforward.  We could think of adding this facility to the standard VM.

BTW, I'm glad you're looking at this.  I'm sure we can simplify start up a lot and hence speed up start up, which is really important eg for cloud computing on containers like docker.

_,,,^..^,,,_ (phone)

> On Oct 7, 2015, at 3:59 PM, Tobias Pape <Das.Linux at gmx.de> wrote:
> Hey all
> what do you think is the best way to trace all context switches
> during start up to the stdout?
> Best regards
>    -Tobias

More information about the Squeak-dev mailing list