type ThreadID … const NoThread … type ProcID … const NoProc … type GoID … const NoGoroutine … type GoState … const GoUndetermined … const GoNotExist … const GoRunnable … const GoRunning … const GoWaiting … const GoSyscall … // Executing returns true if the state indicates that the goroutine is executing // and bound to its thread. func (s GoState) Executing() bool { … } // String returns a human-readable representation of a GoState. // // The format of the returned string is for debugging purposes and is subject to change. func (s GoState) String() string { … } type ProcState … const ProcUndetermined … const ProcNotExist … const ProcRunning … const ProcIdle … // Executing returns true if the state indicates that the proc is executing // and bound to its thread. func (s ProcState) Executing() bool { … } // String returns a human-readable representation of a ProcState. // // The format of the returned string is for debugging purposes and is subject to change. func (s ProcState) String() string { … } type ResourceKind … const ResourceNone … const ResourceGoroutine … const ResourceProc … const ResourceThread … // String returns a human-readable representation of a ResourceKind. // // The format of the returned string is for debugging purposes and is subject to change. func (r ResourceKind) String() string { … } type ResourceID … // MakeResourceID creates a general resource ID from a specific resource's ID. func MakeResourceID[T interface{ … } // Goroutine obtains a GoID from the resource ID. // // r.Kind must be ResourceGoroutine or this function will panic. func (r ResourceID) Goroutine() GoID { … } // Proc obtains a ProcID from the resource ID. // // r.Kind must be ResourceProc or this function will panic. func (r ResourceID) Proc() ProcID { … } // Thread obtains a ThreadID from the resource ID. // // r.Kind must be ResourceThread or this function will panic. func (r ResourceID) Thread() ThreadID { … } // String returns a human-readable string representation of the ResourceID. // // This representation is subject to change and is intended primarily for debugging. func (r ResourceID) String() string { … } type StateTransition … func goStateTransition(id GoID, from, to GoState) StateTransition { … } func procStateTransition(id ProcID, from, to ProcState) StateTransition { … } // Goroutine returns the state transition for a goroutine. // // Transitions to and from states that are Executing are special in that // they change the future execution context. In other words, future events // on the same thread will feature the same goroutine until it stops running. // // Panics if d.Resource.Kind is not ResourceGoroutine. func (d StateTransition) Goroutine() (from, to GoState) { … } // Proc returns the state transition for a proc. // // Transitions to and from states that are Executing are special in that // they change the future execution context. In other words, future events // on the same thread will feature the same goroutine until it stops running. // // Panics if d.Resource.Kind is not ResourceProc. func (d StateTransition) Proc() (from, to ProcState) { … }