Mantis - Squeak
Viewing Issue Advanced Details
7458 VM feature always 01-21-10 04:28 10-10-10 14:25
0007458: [Vm-dev] microsecond timing for GC work
Add #primitiveMicrosecondClock and other VM support of microsecond timing for garbage collection instrumentation and profiling. Change sets, support code modifications are on vm-dev list.
From: John M McIntosh <>
Date: Sun, 17 Jan 2010 15:57:10 -0800
To: Squeak Virtual Machine Development Discussion <>
Subject: [Vm-dev] microsecond timing for GC work

The attached change set and sq.h enable microsecond timing for GC work.
Please review for consideration for VMMaker.
 sq.h [^] (17,405 bytes) 01-21-10 04:31
 JMMAddMicroSecondsForGCTiming.1.cs [^] (16,406 bytes) 01-21-10 04:32
 Interpreter-primitiveUtcWithOffset-dtl.1.cs [^] (2,051 bytes) 01-21-10 04:54 [^] (5,870 bytes) 03-28-10 15:47

01-21-10 04:33   
sq.h and JMMAddMicroSecondsForGCTiming.1.cs are the attachments from John's posting on vm-dev.
01-21-10 04:57   
Interpreter-primitiveUtcWithOffset-dtl.1.cs is an additional primitive to answer microseconds UTC since Posix epoch, plus seconds offset from GMT. Compliments (does not replace) John's microsecond primitive and GC changes.
03-28-10 15:50 contains an updated sq.h with a declaration for "sqInt ioUtcWithOffset(sqLong*, int*)". This provides the needed declarations for both JMMAddMicroSecondsForGCTiming.1.cs and Interpreter-primitiveUtcWithOffset-dtl.1.cs.
03-28-10 15:55   
JMMAddMicroSecondsForGCTiming.1.cs and Interpreter-primitiveUtcWithOffset-dtl.1.cs are included in VMMaker-dtl.164 on SqueakSource.

Default implementations are provided in VMMaker so that platform code updates will not be immediately required. As platform implementations are added, macros should be added in the corresponding config.h files to point to the new implementations (overriding defaults in src/interp.h).
06-01-10 08:39   
On Windows, a 4.0.2 VM returns the millisecondClockValue for the named microsecond primitive.
(This was the implementation)
    "Answer the number of microseconds since the microsecond clock was last reset or rolled over.
    Fall back to millisecond precision if the primitive fails."

    <primitive: 'primitiveMicrosecondClock' module: nil >
    ^self millisecondClockValue * 1000

Also, statistics showing GC time will now be wrong one way or the other, since the method which used to return milliseconds now return microseconds on recent Linux and OSX VMs.

(See f.ex. MessageTally, which will return time spent in incGC of say, 7000% of uptime).

So the switch has already been made on 2 of 3 main platforms, is there some plan for detecting/adjusting code for old millisecond returns for GC times, or do we just have to accept that images will report correctly on some platforms depending on whether we choose to interpret the gc times as milliseconds or microseconds?
10-10-10 14:25   
Included in VMMaker-dtl.164 on SqueakSource.