cpu

package
v0.0.0-...-baa3643 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFutexSnoopSession

func NewFutexSnoopSession(name string, cfg *config.FUTEXSNOOP, buf chan *model.SpyEvent) core.BpfSpyer

func NewOffCpuBpfSession

func NewOffCpuBpfSession(name string, cfg *config.OFFCPU, buf chan *model.SpyEvent) core.BpfSpyer

func NewOnCpuBpfSession

func NewOnCpuBpfSession(name string, cfg *config.ONCPU, buf chan *model.SpyEvent) core.BpfSpyer

Types

type BpfSession

type BpfSession struct {
	Session *core.Session
	// inner field
	PerfBuffer *bpf.PerfBuffer
	// inner field
	Module *bpf.Module
}

func (*BpfSession) ConsumeEvent

func (s *BpfSession) ConsumeEvent() error

func (*BpfSession) Name

func (s *BpfSession) Name() string

func (*BpfSession) Start

func (s *BpfSession) Start() error

func (*BpfSession) Stop

func (s *BpfSession) Stop() error

type FutexSnoopArgs

type FutexSnoopArgs struct {
	Tid              uint32
	Pid              uint32
	TargetLock       uint64
	Stack            bool
	MinDurMs         uint32
	MaxDurMs         uint32
	MaxLockHoldUsers uint32
}

type FutexSnoopSession

type FutexSnoopSession struct {
	Session    *core.Session
	PerfBuffer *bpf.PerfBuffer
	Module     *bpf.Module
	SymSession *symtab.SymSession

	Args FutexSnoopArgs
	// contains filtered or unexported fields
}

func (*FutexSnoopSession) ConsumeEvent

func (b *FutexSnoopSession) ConsumeEvent() error

func (*FutexSnoopSession) HandleEvent

func (b *FutexSnoopSession) HandleEvent(data []byte)

func (*FutexSnoopSession) Name

func (b *FutexSnoopSession) Name() string

func (*FutexSnoopSession) ReadEvent

func (b *FutexSnoopSession) ReadEvent() error

func (*FutexSnoopSession) ResolveStack

func (b *FutexSnoopSession) ResolveStack(syms *bytes.Buffer, stackId int32, pid uint32, userspace bool) error

func (*FutexSnoopSession) Start

func (b *FutexSnoopSession) Start() error

func (*FutexSnoopSession) Stop

func (b *FutexSnoopSession) Stop() error

type LockStat

type LockStat struct {
	UserCnt    uint32
	MaxUserCnt uint32
	Uaddr      uint64
	Comm       [16]byte
	PidTgid    uint64
	Ts         uint64
}

type OffCpuArgs

type OffCpuArgs struct {
	Pid           uint32
	Tgid          uint32
	Min_offcpu_ms uint32
	Max_offcpu_ms uint32
	Onrq_us       uint32
}

type OffCpuEvent

type OffCpuEvent struct {
	Waker         Waker
	Target        Target
	Offtime_delta uint64
	Ts            uint64
}

type OffcpuSession

type OffcpuSession struct {
	Session *core.Session
	// inner filed
	PerfBuffer *bpf.PerfBuffer
	// inner filed
	Module     *bpf.Module
	SymSession *symtab.SymSession

	Args OffCpuArgs
	// contains filtered or unexported fields
}

func (*OffcpuSession) ConsumeEvent

func (b *OffcpuSession) ConsumeEvent() error

func (*OffcpuSession) HandleEvent

func (b *OffcpuSession) HandleEvent(data []byte)

func (*OffcpuSession) Name

func (b *OffcpuSession) Name() string

func (*OffcpuSession) ReadEvent

func (b *OffcpuSession) ReadEvent() error

func (*OffcpuSession) ResolveStack

func (b *OffcpuSession) ResolveStack(syms *bytes.Buffer, stackId int32, pid uint32, userspace bool) error

func (*OffcpuSession) Start

func (b *OffcpuSession) Start() error

func (*OffcpuSession) Stop

func (b *OffcpuSession) Stop() error

type OnCpuArgs

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

type OnCpuEvent

type OnCpuEvent struct {
	Pid       uint32
	KernStack int64
	UserStack int64
	Comm      [16]byte
}

type OncpuSession

type OncpuSession struct {
	Session *core.Session
	// inner filed
	PerfBuffer *bpf.PerfBuffer
	// inner filed
	Module     *bpf.Module
	SymSession *symtab.SymSession
	// contains filtered or unexported fields
}

func (*OncpuSession) ConsumeEvent

func (b *OncpuSession) ConsumeEvent() error

func (*OncpuSession) HandleEvent

func (b *OncpuSession) HandleEvent(data []byte)

func (*OncpuSession) Name

func (b *OncpuSession) Name() string

func (*OncpuSession) PollData

func (b *OncpuSession) PollData()

func (*OncpuSession) ReadEvent

func (b *OncpuSession) ReadEvent() error

func (*OncpuSession) Reset

func (b *OncpuSession) Reset() error

func (*OncpuSession) ResolveStack

func (b *OncpuSession) ResolveStack(syms *bytes.Buffer, stackId int32, pid uint32, userspace bool) error

func (*OncpuSession) Start

func (b *OncpuSession) Start() error

func (*OncpuSession) Stop

func (b *OncpuSession) Stop() error

type Target

type Target struct {
	Pid           uint32
	Tgid          uint32
	W_pid         uint32
	Pad           uint32
	W_Comm        [16]byte
	User_stack_id int32
	Kern_stack_id int32
	Comm          [16]byte
	Oncpu_ns      uint64
	Offcpu_ns     uint64
	Onrq_ns       uint64
	Offcpu_id     uint32
	Oncpu_id      uint32
}

type TaskCounter

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

type TaskLockStat

type TaskLockStat struct {
	Slots        [24]uint32
	Comm         [16]byte
	PidTgid      uint64
	Uaddr        uint64
	UserStackId  int32
	Pad          uint32
	Contended    uint64
	TotalElapsed uint64
	MinDur       uint64
	MaxDur       uint64
	DeltaDur     uint64
	MaxDurTs     uint64
}

type Waker

type Waker struct {
	Pid           uint32
	Tgid          uint32
	T_pid         uint32
	Pad           uint32
	T_Comm        [16]byte
	User_stack_id int32
	Kern_stack_id int32
	Comm          [16]byte
	Oncpu_ns      uint64
	Offcpu_ns     uint64
	Onrq_ns       uint64
	Offcpu_id     uint32
	Oncpu_id      uint32
}

Directories

Path Synopsis
This program demonstrates attaching an eBPF program to a kernel symbol.
This program demonstrates attaching an eBPF program to a kernel symbol.

Jump to

Keyboard shortcuts

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