sysmonitor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package sysmonitor monitor system status

Index

Constants

View Source
const (
	SchedFork = 0b1 << iota
	SchedExec
	SchedExit
)

Variables

This section is empty.

Functions

func AllProcess

func AllProcess() (map[int][2]string, error)

func FindMemberOffsetFromFile

func FindMemberOffsetFromFile(fp string, typeName, memberName string) (int64, error)

func FindStructMemberOffset

func FindStructMemberOffset(data *dwarf.Data, typeName, memberName string) (int64, error)

func FindSymbol

func FindSymbol(path string, re *regexp.Regexp) ([]elf.Symbol, error)

func GetEnv

func GetEnv(key string, dfault string, combineWith ...string) string

GetEnv retrieves the environment variable key. If it does not exist it returns the default. Copy from vendor/github.com/shirou/gopsutil/v3/internal/common/common.go:common.GetEnv

func HostProc

func HostProc(combineWith ...string) string

HostProc returns the value of the host proc path. Context from vendor/github.com/shirou/gopsutil/v3/internal/common/common.go:common.HostProc

func NewRegisterFunc

func NewRegisterFunc(m *manager.Manager, bpfFuncName []string) registerFunc

func NewSchedManger

func NewSchedManger(handler perfHandler) (*manager.Manager, error)

func NewUnRegisterFunc

func NewUnRegisterFunc(m *manager.Manager, bpfFuncName []string) unregisterFunc

func SetLogger

func SetLogger(nl *logger.Logger)

func ShortID

func ShortID(binPath string) string

Types

type ProcInjectC

type ProcInjectC C.struct_proc_inject

type ProcessAttachInfo

type ProcessAttachInfo struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ProcessAttachInfo) AddAtach

func (procAttach *ProcessAttachInfo) AddAtach(name string, tn time.Time)

func (*ProcessAttachInfo) AddCannotAttach

func (procAttach *ProcessAttachInfo) AddCannotAttach(name string, tn time.Time)

func (*ProcessAttachInfo) GetAttachInfo

func (procAttach *ProcessAttachInfo) GetAttachInfo(name string) (time.Time, bool)

func (*ProcessAttachInfo) GetCannotAndAttachInfo

func (procAttach *ProcessAttachInfo) GetCannotAndAttachInfo(name string) (time.Time, bool)

type ProcessInfo

type ProcessInfo struct {
	Pid   int32
	PName string

	ENV             map[string]string
	CMD             string
	ExePath         string
	ExeResolvedPath string
	AttachUProbe    bool
}

type SchedTracer

type SchedTracer struct {
	Manager *manager.Manager

	sync.Mutex
	// contains filtered or unexported fields
}

func NewProcessSchedTracer

func NewProcessSchedTracer(filter *tracing.ProcessFilter) (*SchedTracer, error)

func (*SchedTracer) GetGOSchedMap

func (tracer *SchedTracer) GetGOSchedMap() (map[string]*ebpf.Map, bool)

func (*SchedTracer) ProcessSchedHandler

func (tracer *SchedTracer) ProcessSchedHandler(cpu int, data []byte,
	perfmap *manager.PerfMap, manager *manager.Manager)

func (*SchedTracer) Start

func (tracer *SchedTracer) Start(ctx context.Context) error

func (*SchedTracer) Stop

func (tracer *SchedTracer) Stop() error

type SymLoc

type SymLoc struct {
	Name  string
	Start uint64
	End   uint64
}

type UprobeProcessRegister

type UprobeProcessRegister struct{}

type UprobeRegRule

type UprobeRegRule struct {
	Re         *regexp.Regexp
	Register   func(string) error
	UnRegister func(string) error
}

type UprobeRegister

type UprobeRegister struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUprobeDyncLibRegister

func NewUprobeDyncLibRegister(rules []UprobeRegRule) (*UprobeRegister, error)

func (*UprobeRegister) CleanAll

func (register *UprobeRegister) CleanAll()

func (*UprobeRegister) Monitor

func (register *UprobeRegister) Monitor(ctx context.Context, scanInterval time.Duration)

func (*UprobeRegister) ScanAndUpdate

func (register *UprobeRegister) ScanAndUpdate()

Directories

Path Synopsis
gooffset

Jump to

Keyboard shortcuts

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