github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/trace/v2/event/go122/event.go (about) 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 go122 6 7 import ( 8 "github.com/shogo82148/std/internal/trace/v2/event" 9 ) 10 11 const ( 12 EvNone event.Type = iota 13 14 // Structural events. 15 EvEventBatch 16 EvStacks 17 EvStack 18 EvStrings 19 EvString 20 EvCPUSamples 21 EvCPUSample 22 EvFrequency 23 24 // Procs. 25 EvProcsChange 26 EvProcStart 27 EvProcStop 28 EvProcSteal 29 EvProcStatus 30 31 // Goroutines. 32 EvGoCreate 33 EvGoCreateSyscall 34 EvGoStart 35 EvGoDestroy 36 EvGoDestroySyscall 37 EvGoStop 38 EvGoBlock 39 EvGoUnblock 40 EvGoSyscallBegin 41 EvGoSyscallEnd 42 EvGoSyscallEndBlocked 43 EvGoStatus 44 45 // STW. 46 EvSTWBegin 47 EvSTWEnd 48 49 // GC events. 50 EvGCActive 51 EvGCBegin 52 EvGCEnd 53 EvGCSweepActive 54 EvGCSweepBegin 55 EvGCSweepEnd 56 EvGCMarkAssistActive 57 EvGCMarkAssistBegin 58 EvGCMarkAssistEnd 59 EvHeapAlloc 60 EvHeapGoal 61 62 // Annotations. 63 EvGoLabel 64 EvUserTaskBegin 65 EvUserTaskEnd 66 EvUserRegionBegin 67 EvUserRegionEnd 68 EvUserLog 69 70 // Coroutines. Added in Go 1.23. 71 EvGoSwitch 72 EvGoSwitchDestroy 73 EvGoCreateBlocked 74 ) 75 76 // EventString returns the name of a Go 1.22 event. 77 func EventString(typ event.Type) string 78 79 func Specs() []event.Spec 80 81 type GoStatus uint8 82 83 const ( 84 GoBad GoStatus = iota 85 GoRunnable 86 GoRunning 87 GoSyscall 88 GoWaiting 89 ) 90 91 func (s GoStatus) String() string 92 93 type ProcStatus uint8 94 95 const ( 96 ProcBad ProcStatus = iota 97 ProcRunning 98 ProcIdle 99 ProcSyscall 100 ProcSyscallAbandoned 101 ) 102 103 func (s ProcStatus) String() string 104 105 const ( 106 // Various format-specific constants. 107 MaxBatchSize = 64 << 10 108 MaxFramesPerStack = 128 109 MaxStringSize = 1 << 10 110 )