gorou

package module
v0.0.0-...-ca42210 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

gorou

This is an experimental command line TUI to help parse and analyze goroutine stack trace files. You can sort the stacks by age and filter stacks that match a string. You can also remap paths from the stack back to local source for easier integration to jump to the source (on iTerm you can use CMD+LeftClick to make source paths open in your default editor).

Three panes are displayed. The left pane is a list of goroutines to analyze with the function at the top of the stack listed. The top right pane is the full stack for the currently selected goroutine3 from the left pane. The bottom right pane is for ancestors of the currently selected goroutine. For the ancestor pane to be useful, it is recommended to run you Go program with something like export GODEBUG=tracebackancestors=5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	Package      string
	Function     string
	Arguments    []uint64
	ArgumentsRaw string
	File         string
	Line         int64
}

func (*Frame) Short

func (f *Frame) Short() string

func (*Frame) String

func (f *Frame) String() string

type Frames

type Frames []Frame

func (Frames) First

func (f Frames) First() *Frame

type GoRoutine

type GoRoutine struct {
	Num                   int64
	Status                string
	Age                   time.Duration
	AllReturnAddresses    string
	AllReturnAddressesSHA string
	Stack                 Frames
	Ancestor              *GoRoutine
}

func (*GoRoutine) String

func (gr *GoRoutine) String() string

type GoRoutines

type GoRoutines []*GoRoutine

func (GoRoutines) ByAgeGroups

func (grs GoRoutines) ByAgeGroups() []GoRoutines

func (GoRoutines) ByAgeNum

func (grs GoRoutines) ByAgeNum() GoRoutines

func (GoRoutines) ByNum

func (grs GoRoutines) ByNum() GoRoutines

func (GoRoutines) ByReturnAddress

func (grs GoRoutines) ByReturnAddress() []GoRoutines

func (GoRoutines) ByStatus

func (grs GoRoutines) ByStatus() map[string]GoRoutines

type GroupBy

type GroupBy int
const (
	GroupByNone GroupBy = iota
	GroupByAge
	GroupByReturnAddress
)

type StackTrace

type StackTrace struct {
	GoRoutines GoRoutines
	// contains filtered or unexported fields
}

func NewStackTrace

func NewStackTrace(fileName string, filters, excludes []string) (*StackTrace, error)

type Timeline

type Timeline struct {
	*tview.TextView
	// contains filtered or unexported fields
}

func NewTimeline

func NewTimeline(st *StackTrace, groupBy GroupBy, pkg string, drawDetails func(*GoRoutine)) *Timeline

func (*Timeline) Draw

func (t *Timeline) Draw(screen tcell.Screen)

func (*Timeline) InputHandler

func (t *Timeline) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*Timeline) MouseHandler

func (t *Timeline) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳