Spy.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, December 13, 1991 3:49 pm PST
~
BEGIN
Ref: TYPE ~ REF SpyRep;
WatchAllocationType:
TYPE ~ { none, count, words };
Start:
PROC [watchThreadSwitches:
BOOL ¬
TRUE, watchAllocations: WatchAllocationType ¬ none, watchSignals:
BOOL ¬
FALSE, count:
NAT ¬ 10000]
RETURNS [
BOOL];
count is the number of tree nodes to preallocate.
Returns TRUE on a successful start.
SampleMyStack:
PROC [ignoreHottest:
NAT ¬ 0, increment:
CARD ¬ 1];
Adds a pc stack sample for the current thread; use ignoreHottest to skip recording of hottest frames.
Stop:
PROC
RETURNS [Ref];
Returns NIL if the spy was not running.
WriteTree:
PROC [stream:
IO.
STREAM, ref: Ref];
Writes the tree to a stream for a post-mortem analysis.