pyrobpf

package
v1.38.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MapNamePIDs = "pids"

Variables

This section is empty.

Functions

func LoadProfile

func LoadProfile() (*ebpf.CollectionSpec, error)

LoadProfile returns the embedded CollectionSpec for Profile.

func LoadProfileObjects

func LoadProfileObjects(obj interface{}, opts *ebpf.CollectionOptions) error

LoadProfileObjects loads Profile and converts it into a struct.

The following types are suitable as obj argument:

*ProfileObjects
*ProfilePrograms
*ProfileMaps

See ebpf.CollectionSpec.LoadAndAssign documentation for details.

Types

type PidOp

type PidOp uint32
var (
	PidOpRequestUnknownProcessInfo PidOp = 1
	PidOpDead                      PidOp = 2
	PidOpRequestExecProcessInfo    PidOp = 3
)

type ProfileGlobalConfigT

type ProfileGlobalConfigT struct{ NsPidIno uint64 }

type ProfileIoSampler

type ProfileIoSampler struct {
	Next       uint64
	Count      uint64
	ReadBytes  uint64
	WriteBytes uint64
}

type ProfileIoState

type ProfileIoState struct {
	Key    ProfileSampleKey
	Start  uint64
	Weight uint64
}

type ProfileMapSpecs

type ProfileMapSpecs struct {
	Counts     *ebpf.MapSpec `ebpf:"counts"`
	Events     *ebpf.MapSpec `ebpf:"events"`
	IoReqs     *ebpf.MapSpec `ebpf:"io_reqs"`
	IoSampling *ebpf.MapSpec `ebpf:"io_sampling"`
	Pids       *ebpf.MapSpec `ebpf:"pids"`
	Progs      *ebpf.MapSpec `ebpf:"progs"`
	Stacks     *ebpf.MapSpec `ebpf:"stacks"`
}

ProfileMapSpecs contains maps before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type ProfileMaps

type ProfileMaps struct {
	Counts     *ebpf.Map `ebpf:"counts"`
	Events     *ebpf.Map `ebpf:"events"`
	IoReqs     *ebpf.Map `ebpf:"io_reqs"`
	IoSampling *ebpf.Map `ebpf:"io_sampling"`
	Pids       *ebpf.Map `ebpf:"pids"`
	Progs      *ebpf.Map `ebpf:"progs"`
	Stacks     *ebpf.Map `ebpf:"stacks"`
}

ProfileMaps contains all maps after they have been loaded into the kernel.

It can be passed to LoadProfileObjects or ebpf.CollectionSpec.LoadAndAssign.

func (*ProfileMaps) Close

func (m *ProfileMaps) Close() error

type ProfileObjects

type ProfileObjects struct {
	ProfilePrograms
	ProfileMaps
}

ProfileObjects contains all objects after they have been loaded into the kernel.

It can be passed to LoadProfileObjects or ebpf.CollectionSpec.LoadAndAssign.

func (*ProfileObjects) Close

func (o *ProfileObjects) Close() error

type ProfilePidConfig

type ProfilePidConfig struct{ Type uint8 }

type ProfilePidEvent

type ProfilePidEvent struct {
	Op  uint32
	Pid uint32
}

type ProfileProgramSpecs

type ProfileProgramSpecs struct {
	BioEndioEnter    *ebpf.ProgramSpec `ebpf:"bio_endio_enter"`
	DisassociateCtty *ebpf.ProgramSpec `ebpf:"disassociate_ctty"`
	DoPerfEvent      *ebpf.ProgramSpec `ebpf:"do_perf_event"`
	Exec             *ebpf.ProgramSpec `ebpf:"exec"`
	SubmitBioEnter   *ebpf.ProgramSpec `ebpf:"submit_bio_enter"`
}

ProfileSpecs contains programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type ProfilePrograms

type ProfilePrograms struct {
	BioEndioEnter    *ebpf.Program `ebpf:"bio_endio_enter"`
	DisassociateCtty *ebpf.Program `ebpf:"disassociate_ctty"`
	DoPerfEvent      *ebpf.Program `ebpf:"do_perf_event"`
	Exec             *ebpf.Program `ebpf:"exec"`
	SubmitBioEnter   *ebpf.Program `ebpf:"submit_bio_enter"`
}

ProfilePrograms contains all programs after they have been loaded into the kernel.

It can be passed to LoadProfileObjects or ebpf.CollectionSpec.LoadAndAssign.

func (*ProfilePrograms) Close

func (p *ProfilePrograms) Close() error

type ProfileSampleKey

type ProfileSampleKey struct {
	Pid       uint32
	Flags     uint32
	UserStack int64
}

type ProfileSampleValue

type ProfileSampleValue struct {
	Cpu          uint64
	IoTimeNs     uint64
	IoReadBytes  uint64
	IoWriteBytes uint64
}

type ProfileSpecs

type ProfileSpecs struct {
	ProfileProgramSpecs
	ProfileMapSpecs
}

ProfileSpecs contains maps and programs before they are loaded into the kernel.

It can be passed ebpf.CollectionSpec.Assign.

type ProfilingType

type ProfilingType uint8
var (
	ProfilingTypeUnknown       ProfilingType = 1
	ProfilingTypeFramepointers ProfilingType = 2
	ProfilingTypePython        ProfilingType = 3
	ProfilingTypeError         ProfilingType = 4
)

type SampleKeyFlag

type SampleKeyFlag uint32
var (
	SampleKeyFlagPythonStack    SampleKeyFlag = 1
	SampleKeyFlagStackTruncated SampleKeyFlag = 2
)

Jump to

Keyboard shortcuts

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