Documentation ¶
Overview ¶
Package ptrace processes a runtime trace and enriches it with additional information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Function ¶
type Goroutine ¶
type Goroutine struct { ID uint64 Parent uint64 // Sequential ID of goroutine in the trace SeqID int Function *Function Spans []Span // The actual Start and end times of the goroutine. While spans are bounded to 0 and the end of the trace, the // actual Start and end of the goroutine might be unknown. Start container.Option[trace.Timestamp] End container.Option[trace.Timestamp] UserRegions [][]Span Events []EventID }
func (*Goroutine) EffectiveEnd ¶ added in v0.4.0
func (*Goroutine) EffectiveStart ¶ added in v0.4.0
type Machine ¶
type Machine struct { ID int32 // Sequential ID of machine in the trace SeqID int // OPT(dh): using Span for Ms is wasteful. We don't need tags, stacktrace offsets etc. We only care about what // processor is running at what time. The only benefit of reusing Span is that we can use the same code for // rendering Gs and Ms, but that doesn't seem worth the added cost. Spans []Span Goroutines []Span }
type Processor ¶
type Processor struct { ID int32 // Sequential ID of processor in the trace SeqID int // OPT(dh): using Span for Ps is wasteful. We don't need tags, stacktrace offsets etc. We only care about what // goroutine is running at what time. The only benefit of reusing Span is that we can use the same code for // rendering Gs and Ps, but that doesn't seem worth the added cost. Spans []Span }
type SchedulingState ¶
type SchedulingState uint8
const ( StateNone SchedulingState = iota // Goroutine states StateInactive StateActive StateGCIdle StateGCDedicated StateGCFractional StateBlocked StateBlockedSend StateBlockedRecv StateBlockedSelect StateBlockedSync StateBlockedSyncOnce StateBlockedSyncTriggeringGC StateBlockedCond StateBlockedNet StateBlockedGC StateBlockedSyscall StateStuck StateReady StateCreated StateDone StateGCMarkAssist StateGCSweep // Special states used by user regions and stack frames StateUserRegion StateStack StateCPUSample // Processor states StateRunningG // Machine states StateRunningP StateLast )
type Span ¶
type Span struct { Start trace.Timestamp End trace.Timestamp Event EventID // At is an offset from the top of the stack, skipping over uninteresting runtime frames. At uint8 // We track the scheduling State explicitly, instead of mapping from trace.Event.Type, because we apply pattern // matching to stack traces that may result in more accurate states. For example, we can determine // stateBlockedSyncOnce from the stack trace, and we would otherwise use stateBlockedSync. State SchedulingState Tags SpanTags }
type Spans ¶
Spans is an interface that allows ComputeStatistics to operate on abstract collections of spans, not just slices.
type Statistics ¶
func ComputeStatistics ¶ added in v0.3.0
func ComputeStatistics(spans Spans) Statistics
func (*Statistics) Blocked ¶
func (stat *Statistics) Blocked() time.Duration
func (*Statistics) GCAssist ¶
func (stat *Statistics) GCAssist() time.Duration
func (*Statistics) Inactive ¶
func (stat *Statistics) Inactive() time.Duration
func (*Statistics) Running ¶
func (stat *Statistics) Running() time.Duration
type Task ¶
type Trace ¶
type Trace struct { // OPT(dh): can we get rid of all these pointers? Goroutines []*Goroutine Processors []*Processor Machines []*Machine Functions map[string]*Function GC []Span STW []Span Tasks []*Task HeapSize []Point HeapGoal []Point // Mapping from Goroutine ID to list of CPU sample events CPUSamples map[uint64][]EventID HasCPUSamples bool trace.Trace // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.