allgs

package
v0.0.0-...-f652df5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Status_Gidle means this goroutine was just allocated and has not
	// yet been initialized.
	Status_Gidle = iota // 0

	// Statu_Grunnable means this goroutine is on a run queue. It is
	// not currently executing user code. The stack is not owned.
	Status_Grunnable // 1

	// _Grunning means this goroutine may execute user code. The
	// stack is owned by this goroutine. It is not on a run queue.
	// It is assigned an M and a P (g.m and g.m.p are valid).
	Status_Grunning // 2

	// _Gsyscall means this goroutine is executing a system call.
	// It is not executing user code. The stack is owned by this
	// goroutine. It is not on a run queue. It is assigned an M.
	Status_Gsyscall // 3

	// _Gwaiting means this goroutine is blocked in the runtime.
	// It is not executing user code. It is not on a run queue,
	// but should be recorded somewhere (e.g., a channel wait
	// queue) so it can be ready()d when necessary. The stack is
	// not owned *except* that a channel operation may read or
	// write parts of the stack under the appropriate channel
	// lock. Otherwise, it is not safe to access the stack after a
	// goroutine enters _Gwaiting (e.g., it may get moved).
	Status_Gwaiting // 4

	// _Gmoribund_unused is currently unused, but hardcoded in gdb
	// scripts.
	Status_Gmoribund_unused // 5

	// _Gdead means this goroutine is currently unused. It may be
	// just exited, on a free list, or just being initialized. It
	// is not executing user code. It may or may not have a stack
	// allocated. The G and its stack (if any) are owned by the M
	// that is exiting the G or that obtained the G from the free
	// list.
	Status_Gdead // 6

	// _Gcopystack means this goroutine's stack is being moved. It
	// is not executing user code and is not on a run queue. The
	// stack is owned by the goroutine that put it in _Gcopystack.
	Status_Gcopystack // 8

	// _Gpreempted means this goroutine stopped itself for a
	// suspendG preemption. It is like _Gwaiting, but nothing is
	// yet responsible for ready()ing it. Some suspendG must CAS
	// the status to _Gwaiting to take responsibility for
	// ready()ing this G.
	Status_Gpreempted // 9

	// _Gscan combined with one of the above states other than
	// _Grunning indicates that GC is scanning the stack. The
	// goroutine is not executing user code and the stack is owned
	// by the goroutine that set the _Gscan bit.
	//
	// _Gscanrunning is different: it is used to briefly block
	// state transitions while GC signals the G to scan its own
	// stack. This is otherwise like _Grunning.
	//
	// atomicstatus&~Gscan gives the state the goroutine will
	// return to when the scan completes.
	Status_Gscan          = 0x1000
	Status_Gscanrunnable  = Status_Gscan + Status_Grunnable  // 0x1001
	Status_Gscanrunning   = Status_Gscan + Status_Grunning   // 0x1002
	Status_Gscansyscall   = Status_Gscan + Status_Gsyscall   // 0x1003
	Status_Gscanwaiting   = Status_Gscan + Status_Gwaiting   // 0x1004
	Status_Gscanpreempted = Status_Gscan + Status_Gpreempted // 0x1009
)

defined constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Goroutine

type Goroutine struct {
	// contains filtered or unexported fields
}

Goroutine is a wrapper around *runtime.g with a pointer to the runtime config derived from DWARF.

func (Goroutine) BP

func (g Goroutine) BP() unsafe.Pointer

BP returns the program counter of the goroutine.

TODO(https://github.com/DataExMachina-dev/side-eye/issues/756): Note that this is currently buggy when the goroutine is in a syscall. In later go versions (go1.23+), callers should be able to use syscallbp.

func (Goroutine) Goid

func (g Goroutine) Goid() uint64

Goid returns the ID of the goroutine.

func (Goroutine) PC

func (g Goroutine) PC() uintptr

PC returns the program counter of the goroutine.

func (Goroutine) Status

func (g Goroutine) Status() Status

Status returns the status of the goroutine.

func (Goroutine) Stktopsp

func (g Goroutine) Stktopsp() uintptr

Stktopsp returns the top of the stack of the goroutine.

func (Goroutine) String

func (g Goroutine) String() string

func (Goroutine) SyscallPC

func (g Goroutine) SyscallPC() uintptr

SyscallPC returns the program counter of the syscall.

type GoroutineIterator

type GoroutineIterator struct {
	// contains filtered or unexported fields
}

GoroutineIterator iterates over all goroutines.

func NewGoroutineIterator

func NewGoroutineIterator(cfg *snapshotpb.RuntimeConfig, bssAddrShift uint64) (GoroutineIterator, error)

NewGoroutineIterator creates a new GoroutineIterator given the actual address of the bss section.

func (GoroutineIterator) Iterate

func (it GoroutineIterator) Iterate(f func(Goroutine))

Iterate calls f for each goroutine.

type Status

type Status uint32

Status is the status of a goroutine.

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL