read

package
v0.0.0-...-15dcd12 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2015 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldKindEol    FieldKind = 0
	FieldKindPtr              = 1
	FieldKindString           = 2
	FieldKindSlice            = 3
	FieldKindIface            = 4
	FieldKindEface            = 5

	FieldKindBool       FieldKind = 6
	FieldKindUInt8                = 7
	FieldKindSInt8                = 8
	FieldKindUInt16               = 9
	FieldKindSInt16               = 10
	FieldKindUInt32     FieldKind = 11
	FieldKindSInt32               = 12
	FieldKindUInt64     FieldKind = 13
	FieldKindSInt64               = 14
	FieldKindFloat32              = 15
	FieldKindFloat64              = 16
	FieldKindComplex64            = 17
	FieldKindComplex128           = 18

	FieldKindBytes8      = 19
	FieldKindBytes16     = 20
	FieldKindBytesElided = 21

	TypeKindObject       TypeKind = 0
	TypeKindArray                 = 1
	TypeKindChan                  = 2
	TypeKindConservative          = 127
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocSample

type AllocSample struct {
	Addr uint64        // address of object
	Prof *MemProfEntry // record of allocation site
}

type Data

type Data struct {
	Addr   uint64
	Data   []byte
	Fields []Field
	Edges  []Edge
}

type Defer

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

type Dump

type Dump struct {
	Order      binary.ByteOrder
	PtrSize    uint64 // in bytes
	HChanSize  uint64 // channel header size in bytes
	HeapStart  uint64
	HeapEnd    uint64
	TheChar    byte
	Experiment string
	Ncpu       uint64
	Types      []*Type

	Frames       []*StackFrame
	Goroutines   []*GoRoutine
	Otherroots   []*OtherRoot
	Finalizers   []*Finalizer  // pending finalizers, object still live
	QFinal       []*QFinalizer // finalizers which are ready to run
	Osthreads    []*OSThread
	Memstats     *runtime.MemStats
	Data         *Data
	Bss          *Data
	Defers       []*Defer
	Panics       []*Panic
	MemProf      []*MemProfEntry
	AllocSamples []*AllocSample

	// list of full types, indexed by ID
	FTList []*FullType

	// map from type address to type
	TypeMap map[uint64]*Type

	// map from itab address whether the data field of an iface
	// with that itab contains a pointer.
	ItabMap map[uint64]bool
	// contains filtered or unexported fields
}

func Read

func Read(dumpname, execname string) *Dump

func (*Dump) Addr

func (d *Dump) Addr(x ObjId) uint64

func (*Dump) Contents

func (d *Dump) Contents(i ObjId) []byte

func (*Dump) Edges

func (d *Dump) Edges(i ObjId) []Edge

func (*Dump) FindObj

func (d *Dump) FindObj(addr uint64) ObjId

FindObj returns the object id containing the address addr, or -1 if no object contains addr.

func (*Dump) Ft

func (d *Dump) Ft(x ObjId) *FullType

func (*Dump) NumObjects

func (d *Dump) NumObjects() int

NumObjects returns the number of objects in the heap. Valid ObjIds for other calls are from 0 to NumObjects()-1.

func (*Dump) Size

func (d *Dump) Size(x ObjId) uint64

type Edge

type Edge struct {
	To         ObjId  // index of target object in array
	FromOffset uint64 // offset in source object where ptr was found
	ToOffset   uint64 // offset in destination object where ptr lands

	// name of field in the source object, if known
	FieldName string
}

An edge is a directed connection between two objects. The source object is implicit. An edge includes information about where it leaves the source object and where it lands in the destination obj.

type Field

type Field struct {
	Kind     FieldKind
	Offset   uint64
	Name     string
	BaseType string // base type for Ptr, Slice, Iface ("" if not known)
}

A Field is a location in an object where there might be a pointer.

type FieldKind

type FieldKind int

type Finalizer

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

Object obj has a finalizer.

type FullType

type FullType struct {
	Id     int
	Typ    *Type
	Kind   TypeKind
	Size   uint64
	Name   string
	Fields []Field
}

type GoRoutine

type GoRoutine struct {
	Bos  *StackFrame // frame at the top of the stack (i.e. currently running)
	Ctxt ObjId

	Addr uint64

	Goid         uint64
	Gopc         uint64
	Status       uint64
	IsSystem     bool
	IsBackground bool
	WaitSince    uint64
	WaitReason   string
	// contains filtered or unexported fields
}

type MemProfEntry

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

type MemProfFrame

type MemProfFrame struct {
	Func string
	File string
	Line uint64
}

type OSThread

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

type ObjId

type ObjId int
const (
	ObjNil ObjId = -1
)

type OtherRoot

type OtherRoot struct {
	Description string
	Edges       []Edge
	// contains filtered or unexported fields
}

type Panic

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

type QFinalizer

type QFinalizer struct {
	Edges []Edge
	// contains filtered or unexported fields
}

Finalizer that's ready to run

type Reader

type Reader interface {
	Read(p []byte) (n int, err error)
	ReadByte() (c byte, err error)
}

both an io.Reader and an io.ByteReader

type StackFrame

type StackFrame struct {
	Name      string
	Parent    *StackFrame
	Goroutine *GoRoutine
	Depth     uint64
	Data      []byte
	Edges     []Edge

	Addr uint64

	Fields []Field
	// contains filtered or unexported fields
}

type Type

type Type struct {
	Name string // not necessarily unique
	Size uint64

	Fields []Field // ordered in increasing offset order

	Addr uint64
	// contains filtered or unexported fields
}

type TypeKind

type TypeKind int

Jump to

Keyboard shortcuts

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