Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct {
// Func is the name of the function, including package name, e.g. "main.main"
// or "net/http.(*Server).Serve".
Func string `json:"func"`
// File is the absolute path of source file e.g.
// "/go/src/example.org/example/main.go".
File string `json:"file"`
// Line is the line number of inside of the source file that was active when
// the sample was taken.
Line int `json:"line"`
}
Frame is a single call frame on the stack.
type Stack ¶
type Stack struct {
// ID is the goroutine id (aka `goid`).
ID int `json:"id"`
// State is the `atomicstatus` of the goroutine, or if "waiting" the
// `waitreason`.
State string `json:"state"`
// Wait is the approximate duration a goroutine has been waiting or in a
// syscall as determined by the first gc after the wait started. Aka
// `waitsince`.
Wait time.Duration `json:"wait"`
// LockedToThread is true if the goroutine is locked by a thread, aka
// `lockedm`.
LockedToThread bool `json:"lockedToThread"`
// Stack is the stack trace of the goroutine.
Stack []*Frame `json:"stack"`
// FramesElided is true if the stack trace contains a message indicating that
// additional frames were elided. This happens when the stack depth exceeds
// 100.
FramesElided bool `json:"framesElided"`
// CreatedBy is the frame that created this goroutine, nil for main().
CreatedBy *Frame `json:"createdBy"`
// Ancestors are the Goroutines that created this goroutine.
// See GODEBUG=tracebackancestors=n in https://pkg.go.dev/runtime.
Ancestor *Stack `json:"ancestor,omitempty"`
}
func ConvertGoroutines ¶
func ConvertGoroutines(goroutines []*gostackparse.Goroutine) []Stack
ConvertGoroutines converts a slice of *gostackparse.Goroutine to a slice of Stack.
func ParseStack ¶
Click to show internal directories.
Click to hide internal directories.