type generator … // runGenerator produces a trace into ctx by running the generator over the parsed trace. func runGenerator(ctx *traceContext, g generator, parsed *parsedTrace, opts *genOpts) { … } // emitTask emits information about a task into the trace viewer's event stream. // // sortIndex sets the order in which this task will appear related to other tasks, // lowest first. func emitTask(ctx *traceContext, task *trace.UserTaskSummary, sortIndex int) { … } // emitRegion emits goroutine-based slice events to the UI. The caller // must be emitting for a goroutine-oriented trace. // // TODO(mknyszek): Make regions part of the regular generator loop and // treat them like ranges so that we can emit regions in traces oriented // by proc or thread. func emitRegion(ctx *traceContext, region *trace.UserRegionSummary) { … } type stackSampleGenerator … // StackSample implements a stack sample event handler. It expects ev to be one such event. func (g *stackSampleGenerator[R]) StackSample(ctx *traceContext, ev *trace.Event) { … } type globalRangeGenerator … // Sync notifies the generator of an EventSync event. func (g *globalRangeGenerator) Sync() { … } // GlobalRange implements a handler for EventRange* events whose Scope.Kind is ResourceNone. // It expects ev to be one such event. func (g *globalRangeGenerator) GlobalRange(ctx *traceContext, ev *trace.Event) { … } // Finish flushes any outstanding ranges at the end of the trace. func (g *globalRangeGenerator) Finish(ctx *traceContext) { … } type globalMetricGenerator … // GlobalMetric implements an event handler for EventMetric events. ev must be one such event. func (g *globalMetricGenerator) GlobalMetric(ctx *traceContext, ev *trace.Event) { … } type procRangeGenerator … // Sync notifies the generator of an EventSync event. func (g *procRangeGenerator) Sync() { … } // ProcRange implements a handler for EventRange* events whose Scope.Kind is ResourceProc. // It expects ev to be one such event. func (g *procRangeGenerator) ProcRange(ctx *traceContext, ev *trace.Event) { … } // Finish flushes any outstanding ranges at the end of the trace. func (g *procRangeGenerator) Finish(ctx *traceContext) { … } type activeRange … type completedRange … type logEventGenerator … // Log implements a log event handler. It expects ev to be one such event. func (g *logEventGenerator[R]) Log(ctx *traceContext, ev *trace.Event) { … }