Skip to content
  • Douglas Wilson's avatar
    rts: Add --internal-counters RTS flag and several counters · 2918abf7
    Douglas Wilson authored and Ben Gamari's avatar Ben Gamari committed
    The existing internal counters:
    * gc_alloc_block_sync
    * whitehole_spin
    * gen[g].sync
    * gen[1].sync
    
    are now not shown in the -s report unless --internal-counters is also passed.
    
    If --internal-counters is passed we now show the counters above, reformatted, as
    well as several other counters. In particular, we now count the yieldThread()
    calls that SpinLocks do as well as their spins.
    
    The added counters are:
    * gc_spin (spin and yield)
    * mut_spin (spin and yield)
    * whitehole_threadPaused (spin only)
    * whitehole_executeMessage (spin only)
    * whitehole_lockClosure (spin only)
    * waitForGcThreadsd (spin and yield)
    
    As well as the following, which are not SpinLock-like things:
    * any_work
    * do_work
    * scav_find_work
    
    See the Note for descriptions of what these counters are.
    
    We add busy_wait_nops in these loops along with the counter increment where it
    was absent.
    
    Old internal counters output:
    ```
    gc_alloc_block_sync: 0
    whitehole_gc_spin: 0
    gen[0].sync: 0
    ...
    2918abf7