Source file src/internal/trace/event/requirements.go
1 // Copyright 2023 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package event 6 7 // SchedReqs is a set of constraints on what the scheduling 8 // context must look like. 9 type SchedReqs struct { 10 Thread Constraint 11 Proc Constraint 12 Goroutine Constraint 13 } 14 15 // Constraint represents a various presence requirements. 16 type Constraint uint8 17 18 const ( 19 MustNotHave Constraint = iota 20 MayHave 21 MustHave 22 ) 23 24 // UserGoReqs is a common requirement among events that are running 25 // or are close to running user code. 26 var UserGoReqs = SchedReqs{Thread: MustHave, Proc: MustHave, Goroutine: MustHave} 27