util

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxPath = 4096

Constants

Variables

This section is empty.

Functions

func EnterNS

func EnterNS(pid int, nsType string) int

func FindLibMaps

func FindLibMaps(pid int) ([]*procfs.ProcMap, error)

func GetELF

func GetELF(file *FileInfo) (*elf.File, error)

func GetProcessInfo

func GetProcessInfo(pid int, uid *int, gid *int, nspid *int) error

func GetTmpPath

func GetTmpPath(pid int) string

Called just once to fill in tmpPath buffer

func LibPath

func LibPath(name string, maps []*procfs.ProcMap) *procfs.ProcMap

func LookupSymbols

func LookupSymbols(file *FileInfo, elfF *elf.File, symbols map[string]struct{}) (map[string]uintptr, error)

Types

type Field

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

type FileInfo

type FileInfo struct {
	FsInfo       fs.FileInfo
	Path         string
	Pid          int
	StartAddress uintptr
	EndAddress   uintptr
}

func FindLibJVM

func FindLibJVM(pid int) (*FileInfo, error)

type HotSpotFieldTraverser

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

func MakeTraverser

func MakeTraverser(p *JavaProgram, typeNameOffset, fieldNameOffset, isStaticOffset, addressOffset, offsetOffset uint64) *HotSpotFieldTraverser

func (*HotSpotFieldTraverser) FindDynamicAgentLoading

func (t *HotSpotFieldTraverser) FindDynamicAgentLoading(flagName string, flagsByType map[string]Field, entry, stride uint64) (uintptr, error)

func (*HotSpotFieldTraverser) GetAddress

func (t *HotSpotFieldTraverser) GetAddress(entry uint64) (uint64, error)

func (*HotSpotFieldTraverser) GetFieldName

func (t *HotSpotFieldTraverser) GetFieldName(entry uint64) (string, error)

func (*HotSpotFieldTraverser) GetOffset

func (t *HotSpotFieldTraverser) GetOffset(entry uint64) (uint64, error)

func (*HotSpotFieldTraverser) GetStringAt

func (t *HotSpotFieldTraverser) GetStringAt(entry, offset uint64) (string, error)

func (*HotSpotFieldTraverser) GetTypeName

func (t *HotSpotFieldTraverser) GetTypeName(entry uint64) (string, error)

func (*HotSpotFieldTraverser) IsStatic

func (t *HotSpotFieldTraverser) IsStatic(entry uint64) (bool, error)

func (*HotSpotFieldTraverser) ReadEntries

func (t *HotSpotFieldTraverser) ReadEntries(entry, stride uint64) (map[string]map[string]Field, error)

type JavaProgram

type JavaProgram struct {
	Info *FileInfo
	Tids map[int]struct{}
}

func AttachToJavaProgram

func AttachToJavaProgram(fileInfo *FileInfo) (*JavaProgram, error)

func (*JavaProgram) DetachFromJavaProgram

func (p *JavaProgram) DetachFromJavaProgram() error

func (*JavaProgram) ReadMemory

func (p *JavaProgram) ReadMemory(address uintptr, size int) ([]byte, error)

func (*JavaProgram) ReadMemoryIntoBuf

func (p *JavaProgram) ReadMemoryIntoBuf(address uintptr, buf []byte, size int) error

func (*JavaProgram) ReadSymbolValues

func (p *JavaProgram) ReadSymbolValues(syms map[string]uintptr) (map[string]uint64, error)

func (*JavaProgram) ReadUint64

func (p *JavaProgram) ReadUint64(address uintptr) (uint64, error)

func (*JavaProgram) WriteBufInfoMemory

func (p *JavaProgram) WriteBufInfoMemory(address uintptr, buf []byte, size int) error

Jump to

Keyboard shortcuts

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