trace

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect added in v1.0.6

func Collect(f func())

executes f and collect its trace by default trace output will be controlled by XGO_TRACE_OUTPUT

func Enable added in v1.0.3

func Enable()

func Options added in v1.0.6

func Options() *collectOpts

func SetMarshalStack added in v1.0.2

func SetMarshalStack(fn func(root *Root) ([]byte, error))

func WriteFile added in v1.0.17

func WriteFile(name string, data []byte, perm fs.FileMode) error

Types

type FuncInfoExport added in v1.0.3

type FuncInfoExport struct {
	// FullName string
	Pkg          string
	IdentityName string
	Name         string
	RecvType     string
	RecvPtr      bool

	Generic bool

	File string
	Line int

	RecvName string
	ArgNames []string
	ResNames []string

	// is first argument ctx
	FirstArgCtx bool
	// last last result error
	LastResultErr bool
}

func ExportFuncInfo added in v1.0.3

func ExportFuncInfo(c *core.FuncInfo) *FuncInfoExport

type Root

type Root struct {
	// current executed function
	Top      *Stack
	Begin    time.Time
	Children []*Stack
}

func (*Root) Export added in v1.0.3

func (c *Root) Export() *RootExport

type RootExport added in v1.0.3

type RootExport struct {
	// current executed function
	Begin    time.Time
	Children []*StackExport
}

type Stack

type Stack struct {
	FuncInfo *core.FuncInfo

	Begin int64 // us
	End   int64 // us

	Args    core.Object
	Results core.Object
	Panic   bool
	Error   error
	// Recv     interface{}
	// Args     []interface{}
	// Results  []interface{}
	Children []*Stack
}

func (*Stack) Export added in v1.0.3

func (c *Stack) Export() *StackExport

type StackExport added in v1.0.3

type StackExport struct {
	FuncInfo *FuncInfoExport

	Begin int64 // us
	End   int64 // us

	Args    interface{}
	Results interface{}
	Panic   bool
	Error   string

	Children []*StackExport
}

Jump to

Keyboard shortcuts

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