go/src/internal/trace/internal/oldtrace/parser.go

type Timestamp

type Event

type Frame

const FakeP

const TimerP

const NetpollP

const SyscallP

const GCP

const ProfileP

type Trace

type batchOffset

type parser

func (p *parser) discard(n uint64) bool {}

func newParser(r io.Reader, ver version.Version) (*parser, error) {}

// Parse parses Go execution traces from versions 1.11–1.21. The provided reader
// will be read to completion and the entire trace will be materialized in
// memory. That is, this function does not allow incremental parsing.
//
// The reader has to be positioned just after the trace header and vers needs to
// be the version of the trace. This can be achieved by using
// version.ReadHeader.
func Parse(r io.Reader, vers version.Version) (Trace, error) {}

// parse parses, post-processes and verifies the trace.
func (p *parser) parse() (Trace, error) {}

type rawEvent

type proc

const eventsBucketSize

type Events

// grow grows the slice by one and returns a pointer to the new element, without
// overwriting it.
func (l *Events) grow() *Event {}

// append appends v to the slice and returns a pointer to the new element.
func (l *Events) append(v Event) *Event {}

func (l *Events) Ptr(i int) *Event {}

func (l *Events) index(i int) (int, int) {}

func (l *Events) Len() int {}

func (l *Events) Less(i, j int) bool {}

func (l *Events) Swap(i, j int) {}

func (l *Events) Pop() (*Event, bool) {}

func (l *Events) All() func(yield func(ev *Event) bool) {}

// parseEventBatches reads per-P event batches and merges them into a single, consistent
// stream. The high level idea is as follows. Events within an individual batch
// are in correct order, because they are emitted by a single P. So we need to
// produce a correct interleaving of the batches. To do this we take first
// unmerged event from each batch (frontier). Then choose subset that is "ready"
// to be merged, that is, events for which all dependencies are already merged.
// Then we choose event with the lowest timestamp from the subset, merge it and
// repeat. This approach ensures that we form a consistent stream even if
// timestamps are incorrect (condition observed on some machines).
func (p *parser) parseEventBatches() (Events, error) {}

// collectBatchesAndCPUSamples records the offsets of batches and parses CPU samples.
func (p *parser) collectBatchesAndCPUSamples() error {}

const skipArgs

const skipStrings

func (p *parser) readByte() (byte, bool) {}

func (p *parser) readFull(n int) ([]byte, error) {}

// readRawEvent reads a raw event into ev. The slices in ev are only valid until
// the next call to readRawEvent, even when storing to a different location.
func (p *parser) readRawEvent(flags uint, ev *rawEvent) error {}

// loadBatch loads the next batch for pid and appends its contents to events.
func (p *parser) loadBatch(pid int32, events []Event) ([]Event, error) {}

func (p *parser) readStr() (s string, err error) {}

// parseEvent transforms raw events into events.
// It does analyze and verify per-event-type arguments.
func (p *parser) parseEvent(raw *rawEvent, ev *Event) error {}

var ErrTimeOrder

// postProcessTrace does inter-event verification and information restoration.
// The resulting trace is guaranteed to be consistent
// (for example, a P does not run two Gs at the same time, or a G is indeed
// blocked before an unblock event).
func (p *parser) postProcessTrace(events Events) error {}

var errMalformedVarint

// readVal reads unsigned base-128 value from r.
func (p *parser) readVal() (uint64, error) {}

func readValFrom(buf []byte) (v uint64, rem []byte, err error) {}

func (ev *Event) String() string {}

// argNum returns total number of args for the event accounting for timestamps,
// sequence numbers and differences between trace format versions.
func (raw *rawEvent) argNum() int {}

const EvNone

const EvBatch

const EvFrequency

const EvStack

const EvGomaxprocs

const EvProcStart

const EvProcStop

const EvGCStart

const EvGCDone

const EvSTWStart

const EvSTWDone

const EvGCSweepStart

const EvGCSweepDone

const EvGoCreate

const EvGoStart

const EvGoEnd

const EvGoStop

const EvGoSched

const EvGoPreempt

const EvGoSleep

const EvGoBlock

const EvGoUnblock

const EvGoBlockSend

const EvGoBlockRecv

const EvGoBlockSelect

const EvGoBlockSync

const EvGoBlockCond

const EvGoBlockNet

const EvGoSysCall

const EvGoSysExit

const EvGoSysBlock

const EvGoWaiting

const EvGoInSyscall

const EvHeapAlloc

const EvHeapGoal

const EvTimerGoroutine

const EvFutileWakeup

const EvString

const EvGoStartLocal

const EvGoUnblockLocal

const EvGoSysExitLocal

const EvGoStartLabel

const EvGoBlockGC

const EvGCMarkAssistStart

const EvGCMarkAssistDone

const EvUserTaskCreate

const EvUserTaskEnd

const EvUserRegion

const EvUserLog

const EvCPUSample

const EvCount

var EventDescriptions

//gcassert:inline
func (p *parser) allocateStack(size uint64) []uint64 {}

func (tr *Trace) STWReason(kindID uint64) STWReason {}

type STWReason

const STWUnknown

const STWGCMarkTermination

const STWGCSweepTermination

const STWWriteHeapDump

const STWGoroutineProfile

const STWGoroutineProfileCleanup

const STWAllGoroutinesStackTrace

const STWReadMemStats

const STWAllThreadsSyscall

const STWGOMAXPROCS

const STWStartTrace

const STWStopTrace

const STWCountPagesInUse

const STWReadMetricsSlow

const STWReadMemStatsSlow

const STWPageCachePagesLeaked

const STWResetDebugLog

const NumSTWReasons