hal/trace.lisp
Process allocation and garbage-collection evidence for one dynamic extent.
Compute allocated bytes from SBCL's non-allocating profiler counters.
Measure time, allocation, GC time, and collections while executing body.
observation is reset in place and body's values are preserved. SBCL's byte
and GC clocks are process-wide; in a multithreaded image this deliberately
attributes concurrent runtime activity during the observed extent too.
Make a reusable nested CPU trace buffer named label.
Forget trace's zones while retaining its allocated storage for reuse.
Reset trace, bind it dynamically, and record zones established by body.
Measure body as nested zone name for whichever measurement is watching.
TRACY-VALUE, when supplied, is attached to the Tracy zone at exit. It does not affect the bounded CPU trace, whose zones retain time and runtime costs.
Two independent things may be: a Tracy viewer attached to this image, and an opt-in CPU-TRACE capture. Each disabled path is one special-variable test and does not allocate, so instrumenting a frame path costs nothing when nobody is measuring it. Active traces reuse their zone storage after the first capture.
The Tracy zone is the outer one. When only Tracy is watching there is no bookkeeping inside it to measure, and when a CPU-TRACE capture is running its own cost belongs to the zone it is attributed to rather than being hidden from it. #OHNIWM
body occurs once so nested instrumentation does not multiply the
compiler's input. TRACE, rather than INDEX, guards cleanup because
zero is a valid first zone index.
Measure body with concise ambient zone syntax.
specification is either a zone name or (NAME :VALUE FORM). This is the
ordinary spelling for a meaningful region inside a definition; zdefun and
zdefmethod cover whole definitions.
Define a function whose complete dynamic extent is an ambient trace zone.
The inferred name is PACKAGE/FUNCTION. Use (NAME :zone ZONE-NAME) to provide
a more semantic name and :VALUE FORM to attach a Tracy work count.
Define a method whose complete dynamic extent is an ambient trace zone.
The inferred name includes the generic function, non-T required specializers,
and qualifiers. :zone and :VALUE have the same meaning as in zdefun.
Return trace's completed zones in start order.
Print trace as a bounded time, allocation, and GC table.
Process allocation and garbage-collection evidence for one dynamic extent.
The current opt-in CPU trace, or NIL on the ordinary execution path.
(started-usage started-freed ended-usage ended-freed)Subtraction or unary negation.
Addition over compatible quantities.
((observation) &body body)Measure time, allocation, GC time, and collections while executing BODY. OBSERVATION is reset in place and BODY's values are preserved. SBCL's byte and GC clocks are process-wide; in a multithreaded image this deliberately attributes concurrent runtime activity during the observed extent too.
Division of two represented quantities.
(&key label)(trace)(vector minimum-size &key element-type)The maximum of compatible quantities.
Multiplication and scalar scaling.
Logical disjunction of tests and raw truth values.
(trace name)Test whether two compatible scalars are equal.
(specification &body body)Measure BODY with concise ambient zone syntax. SPECIFICATION is either a zone name or (NAME :VALUE FORM). This is the ordinary spelling for a meaningful region inside a definition; ZDEFUN and ZDEFMETHOD cover whole definitions.
(trace index)Logical conjunction of tests and raw truth values.
((trace) &body body)((name &key (tracy-value nil tracy-value-supplied-p)) &body body)Measure BODY as nested zone NAME for whichever measurement is watching. TRACY-VALUE, when supplied, is attached to the Tracy zone at exit. It does not affect the bounded CPU trace, whose zones retain time and runtime costs. Two independent things may be: a Tracy viewer attached to this image, and an opt-in…
((name &key (color 0) (value nil value-supplied-p)) &body body)Measure BODY as a Tracy zone named NAME. When VALUE is supplied, evaluate it as the zone exits and attach the resulting unsigned integer to the zone. This is useful for semantic work counts such as sites visited: Tracy can then distinguish a slower realization from one which simply performed more work. A literal…
Logical negation of one test or raw truth value.
(&body body)The declarations BODY makes, read as a rule body, for a rule to include: the way to write a mixin.
(name-and-options lambda-list &body body)Define a function whose complete dynamic extent is an ambient trace zone. The inferred name is PACKAGE/FUNCTION. Use (NAME :ZONE ZONE-NAME) to provide a more semantic name and :VALUE FORM to attach a Tracy work count.
(name-and-options &rest method-tail)Define a method whose complete dynamic extent is an ambient trace zone. The inferred name includes the generic function, non-T required specializers, and qualifiers. :ZONE and :VALUE have the same meaning as in ZDEFUN.
(trace)(trace index)(trace index)(trace index)(trace &optional (stream *standard-output*))Intent: make a coarse frame explanation one ordinary benchmark away, with an opt-in macro whose disabled path neither constructs events nor changes backend control flow. Evidence: – The trace buffer records a zone name, parent, depth, monotonic start/end ticks, allocated bytes, garbage-collection time, and collections…
Opt-in nested CPU timing zones for live and benchmark measurements.