[squeak-dev] Re: MessageTally problems

Brent Pinkney brent at zamail.co.za
Fri Apr 23 21:11:29 UTC 2010


Hi Andreas,

> Look at primitiveResponse. You need to make sure that
>
> 	ioMSecs() > nextWakeupTick ifTrue:[self checkForInterrupts].

Ok, I have compared the 3.6-0 interp.c against the 3.10-4 interp.c (both from www.squeakvm.org).

I have made a patch to Squeak-3.10-4/platforms/unix/src/vm/interp.c to (hopefully) restore the 3.6 profiling behaviour.
My changes are...


#define DoProfilerTimerCheck 1

sqInt dispatchFunctionPointer(void * aFunctionPointer) {

        int timerPending;
        int startTime;

        /* this is required if the MessageTally is to function correctly */
        if (DoProfilerTimerCheck) {
                timerPending = foo->nextWakeupTick != 0;
                if (timerPending) {
                        startTime = ioLowResMSecs();
                }
        }
        ((void (*)(void))aFunctionPointer)();
        if (DoProfilerTimerCheck) {
                if (timerPending) {
                        if ((ioLowResMSecs()) != startTime) {
                                if (((ioMSecs()) & MillisecondClockMask) >= foo->nextWakeupTick) {
                                        if (foo->successFlag) {
                                                checkForInterrupts();
                                        } else {
                                                foo->interruptCheckCounter = 0;
                                        }
                                }
                        }
                }
        }
}


I would be grateful for any insight as to whether this is the correct change - it seems to profile correctly on my Kubuntu 8.04 
box.

I am willing to pursue this change back into VMMaker once blessed.

Brent





More information about the Squeak-dev mailing list