type traceGoStatus … const traceGoBad … const traceGoRunnable … const traceGoRunning … const traceGoSyscall … const traceGoWaiting … type traceProcStatus … const traceProcBad … const traceProcRunning … const traceProcIdle … const traceProcSyscall … const traceProcSyscallAbandoned … // writeGoStatus emits a GoStatus event as well as any active ranges on the goroutine. // // nosplit because it's part of writing an event for an M, which must not // have any stack growth. // //go:nosplit func (w traceWriter) writeGoStatus(goid uint64, mid int64, status traceGoStatus, markAssist bool, stackID uint64) traceWriter { … } // writeProcStatusForP emits a ProcStatus event for the provided p based on its status. // // The caller must fully own pp and it must be prevented from transitioning (e.g. this can be // called by a forEachP callback or from a STW). // // nosplit because it's part of writing an event for an M, which must not // have any stack growth. // //go:nosplit func (w traceWriter) writeProcStatusForP(pp *p, inSTW bool) traceWriter { … } // writeProcStatus emits a ProcStatus event with all the provided information. // // The caller must have taken ownership of a P's status writing, and the P must be // prevented from transitioning. // // nosplit because it's part of writing an event for an M, which must not // have any stack growth. // //go:nosplit func (w traceWriter) writeProcStatus(pid uint64, status traceProcStatus, inSweep bool) traceWriter { … } // goStatusToTraceGoStatus translates the internal status to tracGoStatus. // // status must not be _Gdead or any status whose name has the suffix "_unused." // // nosplit because it's part of writing an event for an M, which must not // have any stack growth. // //go:nosplit func goStatusToTraceGoStatus(status uint32, wr waitReason) traceGoStatus { … } type traceSchedResourceState … // acquireStatus acquires the right to emit a Status event for the scheduling resource. // // nosplit because it's part of writing an event for an M, which must not // have any stack growth. // //go:nosplit func (r *traceSchedResourceState) acquireStatus(gen uintptr) bool { … } // readyNextGen readies r for the generation following gen. func (r *traceSchedResourceState) readyNextGen(gen uintptr) { … } // statusWasTraced returns true if the sched resource's status was already acquired for tracing. func (r *traceSchedResourceState) statusWasTraced(gen uintptr) bool { … } // setStatusTraced indicates that the resource's status was already traced, for example // when a goroutine is created. func (r *traceSchedResourceState) setStatusTraced(gen uintptr) { … } // nextSeq returns the next sequence number for the resource. func (r *traceSchedResourceState) nextSeq(gen uintptr) traceArg { … }