Movatterモバイル変換


[0]ホーム

URL:


trace

packagestandard library
go1.25.5Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License:BSD-3-ClauseImports:19Imported by:0

Details

Repository

cs.opensource.google/go/go

Links

Documentation

Index

Constants

View Source
const (// NoTask indicates the lack of a task.NoTask =TaskID(^uint64(0))// BackgroundTask is the global task that events are attached to if there was// no other task in the context at the point the event was emitted.BackgroundTask =TaskID(0))
View Source
const NoGoroutine =GoID(-1)

NoGoroutine indicates that the relevant events don't correspond to anygoroutine in particular.

View Source
const NoProc =ProcID(-1)

NoProc indicates that the relevant events don't correspond to anyP in particular.

View Source
const NoThread =ThreadID(-1)

NoThread indicates that the relevant events don't correspond to anythread in particular.

Variables

View Source
var NoStack =Stack{}

NoStack is a sentinel value that can be compared against any Stack value, indicatinga lack of a stack trace.

Functions

funcIsSystemGoroutineadded ingo1.19

func IsSystemGoroutine(entryFnstring)bool

funcMutatorUtilizationV2added ingo1.22.0

func MutatorUtilizationV2(events []Event, flagsUtilFlags) [][]MutatorUtil

MutatorUtilizationV2 returns a set of mutator utilization functionsfor the given v2 trace, passed as an io.Reader. Each function willalways end with 0 utilization. The bounds of each function are implicitin the first and last event; outside of these bounds each function isundefined.

If the UtilPerProc flag is not given, this always returns a singleutilization function. Otherwise, it returns one function per P.

funcRelatedGoroutinesV2added ingo1.22.0

func RelatedGoroutinesV2(events []Event, goidGoID) map[GoID]struct{}

RelatedGoroutinesV2 finds a set of goroutines related to goroutine goid for v2 traces.The association is based on whether they have synchronized with each other in the Goscheduler (one has unblocked another).

Types

typeClockSnapshotadded ingo1.25.0

type ClockSnapshot struct {// Trace is a snapshot of the trace clock.TraceTime// Wall is a snapshot of the system's wall clock.Walltime.Time// Mono is a snapshot of the system's monotonic clock.Monouint64}

ClockSnapshot represents a near-simultaneous clock reading of severaldifferent system clocks. The snapshot can be used as a reference to converttimestamps to different clocks, which is helpful for correlating timestampswith data captured by other tools.

typeEvent

type Event struct {// contains filtered or unexported fields}

Event represents a single event in the trace.

func (Event)Experimentaladded ingo1.23.0

func (eEvent) Experimental()ExperimentalEvent

Experimental returns a view of the raw event for an experimental event.

Panics if Kind != EventExperimental.

func (Event)Goroutineadded ingo1.23.0

func (eEvent) Goroutine()GoID

Goroutine returns the ID of the goroutine that was executing whenthis event happened. It describes part of the execution contextfor this event.

Note that for goroutine state transitions this always refers to thestate before the transition. For example, if a goroutine is juststarting to run on this thread and/or proc, then this will returnNoGoroutine. In this case, the goroutine starting to run will becan be found at Event.StateTransition().Resource.

func (Event)Kindadded ingo1.23.0

func (eEvent) Kind()EventKind

Kind returns the kind of event that this is.

func (Event)Labeladded ingo1.23.0

func (eEvent) Label()Label

Label returns details about a Label event.

Panics if Kind != EventLabel.

func (Event)Logadded ingo1.23.0

func (eEvent) Log()Log

Log returns details about a Log event.

Panics if Kind != EventLog.

func (Event)Metricadded ingo1.23.0

func (eEvent) Metric()Metric

Metric returns details about a Metric event.

Panics if Kind != EventMetric.

func (Event)Procadded ingo1.23.0

func (eEvent) Proc()ProcID

Proc returns the ID of the proc this event event pertains to.

Note that for proc state transitions this always refers to thestate before the transition. For example, if a proc is juststarting to run on this thread, then this will return NoProc.

func (Event)Rangeadded ingo1.23.0

func (eEvent) Range()Range

Range returns details about an EventRangeBegin, EventRangeActive, or EventRangeEnd event.

Panics if Kind != EventRangeBegin, Kind != EventRangeActive, and Kind != EventRangeEnd.

func (Event)RangeAttributesadded ingo1.23.0

func (eEvent) RangeAttributes() []RangeAttribute

RangeAttributes returns attributes for a completed range.

Panics if Kind != EventRangeEnd.

func (Event)Regionadded ingo1.23.0

func (eEvent) Region()Region

Region returns details about a RegionBegin or RegionEnd event.

Panics if Kind != EventRegionBegin and Kind != EventRegionEnd.

func (Event)Stackadded ingo1.23.0

func (eEvent) Stack()Stack

Stack returns a handle to a stack associated with the event.

This represents a stack trace at the current moment in time forthe current execution context.

func (Event)StateTransitionadded ingo1.23.0

func (eEvent) StateTransition()StateTransition

StateTransition returns details about a StateTransition event.

Panics if Kind != EventStateTransition.

func (Event)Stringadded ingo1.11

func (eEvent) String()string

String returns the event as a human-readable string.

The format of the string is intended for debugging and is subject to change.

func (Event)Syncadded ingo1.25.0

func (eEvent) Sync()Sync

Sync returns details that are relevant for the following events, up to but excluding thenext EventSync event.

func (Event)Taskadded ingo1.23.0

func (eEvent) Task()Task

Task returns details about a TaskBegin or TaskEnd event.

Panics if Kind != EventTaskBegin and Kind != EventTaskEnd.

func (Event)Threadadded ingo1.23.0

func (eEvent) Thread()ThreadID

Thread returns the ID of the thread this event pertains to.

Note that for thread state transitions this always refers to thestate before the transition. For example, if a thread is juststarting to run, then this will return NoThread.

Note: tracking thread state is not currently supported, so thiswill always return a valid thread ID. However thread state transitionsmay be tracked in the future, and callers must be robust to thispossibility.

func (Event)Timeadded ingo1.23.0

func (eEvent) Time()Time

Time returns the timestamp of the event.

typeEventKindadded ingo1.23.0

type EventKinduint16

EventKind indicates the kind of event this is.

Use this information to obtain a more specific event thatallows access to more detailed information.

const (EventBadEventKind =iota// EventKindSync is an event that indicates a global synchronization// point in the trace. At the point of a sync event, the// trace reader can be certain that all resources (e.g. threads,// goroutines) that have existed until that point have been enumerated.EventSync// EventMetric is an event that represents the value of a metric at// a particular point in time.EventMetric// EventLabel attaches a label to a resource.EventLabel// EventStackSample represents an execution sample, indicating what a// thread/proc/goroutine was doing at a particular point in time via// its backtrace.//// Note: Samples should be considered a close approximation of// what a thread/proc/goroutine was executing at a given point in time.// These events may slightly contradict the situation StateTransitions// describe, so they should only be treated as a best-effort annotation.EventStackSample// EventRangeBegin and EventRangeEnd are a pair of generic events representing// a special range of time. Ranges are named and scoped to some resource// (identified via ResourceKind). A range that has begun but has not ended// is considered active.//// EvRangeBegin and EvRangeEnd will share the same name, and an End will always// follow a Begin on the same instance of the resource. The associated// resource ID can be obtained from the Event. ResourceNone indicates the// range is globally scoped. That is, any goroutine/proc/thread can start or// stop, but only one such range may be active at any given time.//// EventRangeActive is like EventRangeBegin, but indicates that the range was// already active. In this case, the resource referenced may not be in the current// context.EventRangeBeginEventRangeActiveEventRangeEnd// EvTaskBegin and EvTaskEnd are a pair of events representing a runtime/trace.Task.EventTaskBeginEventTaskEnd// EventRegionBegin and EventRegionEnd are a pair of events represent a runtime/trace.Region.EventRegionBeginEventRegionEnd// EventLog represents a runtime/trace.Log call.EventLog// EventStateTransition represents a state change for some resource.EventStateTransition// EventExperimental is an experimental event that is unvalidated and exposed in a raw form.// Users are expected to understand the format and perform their own validation. These events// may always be safely ignored.EventExperimental)

func (EventKind)Stringadded ingo1.23.0

func (eEventKind) String()string

String returns a string form of the EventKind.

typeExperimentalBatchadded ingo1.23.0

type ExperimentalBatch struct {// Thread is the ID of the thread that produced a packet of data.ThreadThreadID// Data is a packet of unparsed data all produced by one thread.Data []byte}

ExperimentalBatch represents a packet of unparsed data along with metadata about that packet.

typeExperimentalEventadded ingo1.23.0

type ExperimentalEvent struct {// Name is the name of the event.Namestring// Experiment is the name of the experiment this event is a part of.Experimentstring// Args lists the names of the event's arguments in order.Args []string// contains filtered or unexported fields}

ExperimentalEvent presents a raw view of an experimental event's arguments and their names.

func (ExperimentalEvent)ArgValueadded ingo1.25.0

func (eExperimentalEvent) ArgValue(iint)Value

ArgValue returns a typed Value for the i'th argument in the experimental event.

typeGoIDadded ingo1.23.0

type GoIDint64

GoID is the runtime-internal G structure's goid field. This is uniquefor each goroutine.

typeGoStateadded ingo1.23.0

type GoStateuint8

GoState represents the state of a goroutine.

New GoStates may be added in the future. Users of this type must be robustto that possibility.

const (GoUndeterminedGoState =iota// No information is known about the goroutine.GoNotExist// Goroutine does not exist.GoRunnable// Goroutine is runnable but not running.GoRunning// Goroutine is running.GoWaiting// Goroutine is waiting on something to happen.GoSyscall// Goroutine is in a system call.)

func (GoState)Executingadded ingo1.23.0

func (sGoState) Executing()bool

Executing returns true if the state indicates that the goroutine is executingand bound to its thread.

func (GoState)Stringadded ingo1.23.0

func (sGoState) String()string

String returns a human-readable representation of a GoState.

The format of the returned string is for debugging purposes and is subject to change.

typeGoroutineExecStatsadded ingo1.22.0

type GoroutineExecStats struct {// These stats are all non-overlapping.ExecTimetime.DurationSchedWaitTimetime.DurationBlockTimeByReason map[string]time.DurationSyscallTimetime.DurationSyscallBlockTimetime.Duration// TotalTime is the duration of the goroutine's presence in the trace.// Necessarily overlaps with other stats.TotalTimetime.Duration// Total time the goroutine spent in certain ranges; may overlap// with other stats.RangeTime map[string]time.Duration}

GoroutineExecStats contains statistics about a goroutine's executionduring a period of time.

func (GoroutineExecStats)NonOverlappingStatsadded ingo1.22.0

func (sGoroutineExecStats) NonOverlappingStats() map[string]time.Duration

func (GoroutineExecStats)UnknownTimeadded ingo1.22.0

func (sGoroutineExecStats) UnknownTime()time.Duration

UnknownTime returns whatever isn't accounted for in TotalTime.

typeGoroutineSummaryadded ingo1.22.0

type GoroutineSummary struct {IDGoIDNamestring// A non-unique human-friendly identifier for the goroutine.PCuint64// The first PC we saw for the entry function of the goroutineCreationTimeTime// Timestamp of the first appearance in the trace.StartTimeTime// Timestamp of the first time it started running. 0 if the goroutine never ran.EndTimeTime// Timestamp of when the goroutine exited. 0 if the goroutine never exited.// List of regions in the goroutine, sorted based on the start time.Regions []*UserRegionSummary// Statistics of execution time during the goroutine execution.GoroutineExecStats// contains filtered or unexported fields}

GoroutineSummary contains statistics and execution details of a single goroutine.(For v2 traces.)

typeLabeladded ingo1.23.0

type Label struct {// Label is the label applied to some resource.Labelstring// Resource is the resource to which this label should be applied.ResourceResourceID}

Label provides details about a Label event.

typeLogadded ingo1.23.0

type Log struct {// Task is the ID of the task this region is associated with.TaskTaskID// Category is the category that was passed to runtime/trace.Log or runtime/trace.Logf.Categorystring// Message is the message that was passed to runtime/trace.Log or runtime/trace.Logf.Messagestring}

Log provides details about a Log event.

typeMMUCurveadded ingo1.12

type MMUCurve struct {// contains filtered or unexported fields}

An MMUCurve is the minimum mutator utilization curve acrossmultiple window sizes.

funcNewMMUCurveadded ingo1.12

func NewMMUCurve(utils [][]MutatorUtil) *MMUCurve

NewMMUCurve returns an MMU curve for the given mutator utilizationfunction.

func (*MMUCurve)Examplesadded ingo1.12

func (c *MMUCurve) Examples(windowtime.Duration, nint) (worst []UtilWindow)

Examples returns n specific examples of the lowest mutatorutilization for the given window size. The returned windows will bedisjoint (otherwise there would be a huge number ofmostly-overlapping windows at the single lowest point). There areno guarantees on which set of disjoint windows this returns.

func (*MMUCurve)MMUadded ingo1.12

func (c *MMUCurve) MMU(windowtime.Duration) (mmufloat64)

MMU returns the minimum mutator utilization for the given timewindow. This is the minimum utilization for all windows of thisduration across the execution. The returned value is in the range[0, 1].

func (*MMUCurve)MUDadded ingo1.12

func (c *MMUCurve) MUD(windowtime.Duration, quantiles []float64) []float64

MUD returns mutator utilization distribution quantiles for thegiven window size.

The mutator utilization distribution is the distribution of meanmutator utilization across all windows of the given window size inthe trace.

The minimum mutator utilization is the minimum (0th percentile) ofthis distribution. (However, if only the minimum is desired, it'smore efficient to use the MMU method.)

typeMetricadded ingo1.23.0

type Metric struct {// Name is the name of the sampled metric.//// Names follow the same convention as metric names in the// runtime/metrics package, meaning they include the unit.// Names that match with the runtime/metrics package represent// the same quantity. Note that this corresponds to the// runtime/metrics package for the Go version this trace was// collected for.Namestring// Value is the sampled value of the metric.//// The Value's Kind is tied to the name of the metric, and so is// guaranteed to be the same for metric samples for the same metric.ValueValue}

Metric provides details about a Metric event.

typeMutatorUtiladded ingo1.12

type MutatorUtil struct {Timeint64// Util is the mean mutator utilization starting at Time. This// is in the range [0, 1].Utilfloat64}

MutatorUtil is a change in mutator utilization at a particulartime. Mutator utilization functions are represented as atime-ordered []MutatorUtil.

typeProcIDadded ingo1.23.0

type ProcIDint64

ProcID is the runtime-internal G structure's id field. This is uniquefor each P.

typeProcStateadded ingo1.23.0

type ProcStateuint8

ProcState represents the state of a proc.

New ProcStates may be added in the future. Users of this type must be robustto that possibility.

const (ProcUndeterminedProcState =iota// No information is known about the proc.ProcNotExist// Proc does not exist.ProcRunning// Proc is running.ProcIdle// Proc is idle.)

func (ProcState)Executingadded ingo1.23.0

func (sProcState) Executing()bool

Executing returns true if the state indicates that the proc is executingand bound to its thread.

func (ProcState)Stringadded ingo1.23.0

func (sProcState) String()string

String returns a human-readable representation of a ProcState.

The format of the returned string is for debugging purposes and is subject to change.

typeRangeadded ingo1.23.0

type Range struct {// Name is a human-readable name for the range.//// This name can be used to identify the end of the range for the resource// its scoped to, because only one of each type of range may be active on// a particular resource. The relevant resource should be obtained from the// Event that produced these details. The corresponding RangeEnd will have// an identical name.Namestring// Scope is the resource that the range is scoped to.//// For example, a ResourceGoroutine scope means that the same goroutine// must have a start and end for the range, and that goroutine can only// have one range of a particular name active at any given time. The// ID that this range is scoped to may be obtained via Event.Goroutine.//// The ResourceNone scope means that the range is globally scoped. As a// result, any goroutine/proc/thread may start or end the range, and only// one such named range may be active globally at any given time.//// For RangeBegin and RangeEnd events, this will always reference some// resource ID in the current execution context. For RangeActive events,// this may reference a resource not in the current context. Prefer Scope// over the current execution context.ScopeResourceID}

Range provides details about a Range event.

typeRangeAttributeadded ingo1.23.0

type RangeAttribute struct {// Name is the human-readable name for the range.Namestring// Value is the value of the attribute.ValueValue}

RangeAttributes provides attributes about a completed Range.

typeReaderadded ingo1.23.0

type Reader struct {// contains filtered or unexported fields}

Reader reads a byte stream, validates it, and produces trace events.

Provided the trace is non-empty the Reader always produces a Syncevent as the first event, and a Sync event as the last event.(There may also be any number of Sync events in the middle, too.)

funcNewReaderadded ingo1.23.0

func NewReader(rio.Reader) (*Reader,error)

NewReader creates a new trace reader.

func (*Reader)ReadEventadded ingo1.23.0

func (r *Reader) ReadEvent() (eEvent, errerror)

ReadEvent reads a single event from the stream.

If the stream has been exhausted, it returns an invalid event and io.EOF.

typeRegionadded ingo1.23.0

type Region struct {// Task is the ID of the task this region is associated with.TaskTaskID// Type is the regionType that was passed to runtime/trace.StartRegion or runtime/trace.WithRegion.Typestring}

Region provides details about a Region event.

typeResourceIDadded ingo1.23.0

type ResourceID struct {// Kind is the kind of resource this ID is for.KindResourceKind// contains filtered or unexported fields}

ResourceID represents a generic resource ID.

funcMakeResourceIDadded ingo1.23.0

func MakeResourceID[T interface{GoID |ProcID |ThreadID }](id T)ResourceID

MakeResourceID creates a general resource ID from a specific resource's ID.

func (ResourceID)Goroutineadded ingo1.23.0

func (rResourceID) Goroutine()GoID

Goroutine obtains a GoID from the resource ID.

r.Kind must be ResourceGoroutine or this function will panic.

func (ResourceID)Procadded ingo1.23.0

func (rResourceID) Proc()ProcID

Proc obtains a ProcID from the resource ID.

r.Kind must be ResourceProc or this function will panic.

func (ResourceID)Stringadded ingo1.23.0

func (rResourceID) String()string

String returns a human-readable string representation of the ResourceID.

This representation is subject to change and is intended primarily for debugging.

func (ResourceID)Threadadded ingo1.23.0

func (rResourceID) Thread()ThreadID

Thread obtains a ThreadID from the resource ID.

r.Kind must be ResourceThread or this function will panic.

typeResourceKindadded ingo1.23.0

type ResourceKinduint8

ResourceKind indicates a kind of resource that has a state machine.

New ResourceKinds may be added in the future. Users of this type must be robustto that possibility.

const (ResourceNoneResourceKind =iota// No resource.ResourceGoroutine// Goroutine.ResourceProc// Proc.ResourceThread// Thread.)

func (ResourceKind)Stringadded ingo1.23.0

func (rResourceKind) String()string

String returns a human-readable representation of a ResourceKind.

The format of the returned string is for debugging purposes and is subject to change.

typeStackadded ingo1.23.0

type Stack struct {// contains filtered or unexported fields}

Stack represents a stack. It's really a handle to a stack and it's trivially comparable.

If two Stacks are equal then their Frames are guaranteed to be identical. If they are notequal, however, their Frames may still be equal.

func (Stack)Framesadded ingo1.23.0

func (sStack) Frames()iter.Seq[StackFrame]

Frames is an iterator over the frames in a Stack.

typeStackFrameadded ingo1.23.0

type StackFrame struct {// PC is the program counter of the function call if this// is not a leaf frame. If it's a leaf frame, it's the point// at which the stack trace was taken.PCuint64// Func is the name of the function this frame maps to.Funcstring// File is the file which contains the source code of Func.Filestring// Line is the line number within File which maps to PC.Lineuint64}

StackFrame represents a single frame of a stack.

typeStateTransitionadded ingo1.23.0

type StateTransition struct {// Resource is the resource this state transition is for.ResourceResourceID// Reason is a human-readable reason for the state transition.Reasonstring// Stack is the stack trace of the resource making the state transition.//// This is distinct from the result (Event).Stack because it pertains to// the transitioning resource, not any of the ones executing the event// this StateTransition came from.//// An example of this difference is the NotExist -> Runnable transition for// goroutines, which indicates goroutine creation. In this particular case,// a Stack here would refer to the starting stack of the new goroutine, and// an (Event).Stack would refer to the stack trace of whoever created the// goroutine.StackStack// contains filtered or unexported fields}

StateTransition provides details about a StateTransition event.

func (StateTransition)Goroutineadded ingo1.23.0

func (dStateTransition) Goroutine() (from, toGoState)

Goroutine returns the state transition for a goroutine.

Transitions to and from states that are Executing are special in thatthey change the future execution context. In other words, future eventson the same thread will feature the same goroutine until it stops running.

Panics if d.Resource.Kind is not ResourceGoroutine.

func (StateTransition)Procadded ingo1.23.0

func (dStateTransition) Proc() (from, toProcState)

Proc returns the state transition for a proc.

Transitions to and from states that are Executing are special in thatthey change the future execution context. In other words, future eventson the same thread will feature the same goroutine until it stops running.

Panics if d.Resource.Kind is not ResourceProc.

typeSummarizeradded ingo1.22.0

type Summarizer struct {// contains filtered or unexported fields}

Summarizer constructs per-goroutine time statistics for v2 traces.

funcNewSummarizeradded ingo1.22.0

func NewSummarizer() *Summarizer

NewSummarizer creates a new struct to build goroutine stats from a trace.

func (*Summarizer)Eventadded ingo1.22.0

func (s *Summarizer) Event(ev *Event)

Event feeds a single event into the stats summarizer.

func (*Summarizer)Finalizeadded ingo1.22.0

func (s *Summarizer) Finalize() *Summary

Finalize indicates to the summarizer that we're done processing the trace.It cleans up any remaining state and returns the full summary.

typeSummaryadded ingo1.22.0

type Summary struct {Goroutines map[GoID]*GoroutineSummaryTasks      map[TaskID]*UserTaskSummary}

Summary is the analysis result produced by the summarizer.

typeSyncadded ingo1.25.0

type Sync struct {// N indicates that this is the Nth sync event in the trace.Nint// ClockSnapshot is a snapshot of different clocks taken in close in time// that can be used to correlate trace events with data captured by other// tools. May be nil for older trace versions.ClockSnapshot *ClockSnapshot// ExperimentalBatches contain all the unparsed batches of data for a given experiment.ExperimentalBatches map[string][]ExperimentalBatch}

Sync contains details potentially relevant to all the following events, up to but excludingthe next EventSync event.

typeTaskadded ingo1.23.0

type Task struct {// ID is a unique identifier for the task.//// This can be used to associate the beginning of a task with its end.IDTaskID// ParentID is the ID of the parent task.ParentTaskID// Type is the taskType that was passed to runtime/trace.NewTask.//// May be "" if a task's TaskBegin event isn't present in the trace.Typestring}

Task provides details about a Task event.

typeTaskIDadded ingo1.23.0

type TaskIDuint64

TaskID is the internal ID of a task used to disambiguate tasks (even if theyare of the same type).

typeThreadIDadded ingo1.23.0

type ThreadIDint64

ThreadID is the runtime-internal M structure's ID. This is uniquefor each OS thread.

typeTimeadded ingo1.23.0

type Timeint64

Time is a timestamp in nanoseconds.

It corresponds to the monotonic clock on the platform that thetrace was taken, and so is possible to correlate with timestampsfor other traces taken on the same machine using the same clock(i.e. no reboots in between).

The actual absolute value of the timestamp is only meaningful inrelation to other timestamps from the same clock.

BUG: Timestamps coming from traces on Windows platforms areonly comparable with timestamps from the same trace. Timestampsacross traces cannot be compared, because the system clock isnot used as of Go 1.22.

BUG: Traces produced by Go versions 1.21 and earlier cannot becompared with timestamps from other traces taken on the samemachine. This is because the system clock was not used at allto collect those timestamps.

func (Time)Subadded ingo1.23.0

func (tTime) Sub(t0Time)time.Duration

Sub subtracts t0 from t, returning the duration in nanoseconds.

typeUserRegionSummaryadded ingo1.22.0

type UserRegionSummary struct {TaskIDTaskIDNamestring// Region start event. Normally EventRegionBegin event or nil,// but can be a state transition event from NotExist or Undetermined// if the region is a synthetic region representing task inheritance// from the parent goroutine.Start *Event// Region end event. Normally EventRegionEnd event or nil,// but can be a state transition event to NotExist if the goroutine// terminated without explicitly ending the region.End *EventGoroutineExecStats}

UserRegionSummary represents a region and goroutine execution statswhile the region was active. (For v2 traces.)

typeUserTaskSummaryadded ingo1.22.0

type UserTaskSummary struct {IDTaskIDNamestringParent   *UserTaskSummary// nil if the parent is unknown.Children []*UserTaskSummary// Task begin event. An EventTaskBegin event or nil.Start *Event// End end event. Normally EventTaskEnd event or nil.End *Event// Logs is a list of EventLog events associated with the task.Logs []*Event// List of regions in the task, sorted based on the start time.Regions []*UserRegionSummary// Goroutines is the set of goroutines associated with this task.Goroutines map[GoID]*GoroutineSummary}

UserTaskSummary represents a task in the trace.

func (*UserTaskSummary)Completeadded ingo1.22.0

func (s *UserTaskSummary) Complete()bool

Complete returns true if we have complete information about the taskfrom the trace: both a start and an end.

func (*UserTaskSummary)Descendentsadded ingo1.22.0

func (s *UserTaskSummary) Descendents() []*UserTaskSummary

Descendents returns a slice consisting of itself (always the first task returned),and the transitive closure of all of its children.

typeUtilFlagsadded ingo1.12

type UtilFlagsint

UtilFlags controls the behavior of MutatorUtilization.

const (// UtilSTW means utilization should account for STW events.// This includes non-GC STW events, which are typically user-requested.UtilSTWUtilFlags = 1 <<iota// UtilBackground means utilization should account for// background mark workers.UtilBackground// UtilAssist means utilization should account for mark// assists.UtilAssist// UtilSweep means utilization should account for sweeping.UtilSweep// UtilPerProc means each P should be given a separate// utilization function. Otherwise, there is a single function// and each P is given a fraction of the utilization.UtilPerProc)

typeUtilWindowadded ingo1.12

type UtilWindow struct {Timeint64// MutatorUtil is the mean mutator utilization in this window.MutatorUtilfloat64}

UtilWindow is a specific window at Time.

typeValueadded ingo1.23.0

type Value struct {// contains filtered or unexported fields}

Value is a dynamically-typed value obtained from a trace.

func (Value)Kindadded ingo1.23.0

func (vValue) Kind()ValueKind

Kind returns the ValueKind of the value.

It represents the underlying structure of the value.

New ValueKinds may be added in the future. Users of this type must be robustto that possibility.

func (Value)Stringadded ingo1.25.0

func (vValue) String()string

String returns the string value for a ValueString, and otherwisea string representation of the value for other kinds of values.

func (Value)Uint64added ingo1.23.0

func (vValue) Uint64()uint64

Uint64 returns the uint64 value for a ValueUint64.

Panics if this Value's Kind is not ValueUint64.

typeValueKindadded ingo1.23.0

type ValueKinduint8

ValueKind is the type of a dynamically-typed value from a trace.

const (ValueBadValueKind =iotaValueUint64ValueString)

Source Files

View all Source files

Directories

PathSynopsis
internal
tracev1
Package tracev1 implements a parser for Go execution traces from versions 1.11–1.21.
Package tracev1 implements a parser for Go execution traces from versions 1.11–1.21.
Package raw provides an interface to interpret and emit Go execution traces.
Package raw provides an interface to interpret and emit Go execution traces.
Package tracev2 contains definitions for the v2 execution trace wire format.
Package tracev2 contains definitions for the v2 execution trace wire format.
format
Package traceviewer provides definitions of the JSON data structures used by the Chrome trace viewer.
Package traceviewer provides definitions of the JSON data structures used by the Chrome trace viewer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp