ebpf

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcContainerCgroupPath = "/proc/1/cgroup"
	ProcContainerSchedPath  = "/proc/1/sched"
)
View Source
const (
	SysKernelBtfVmlinux = "/sys/kernel/btf/vmlinux"
	ConfigDebugInfoBtf  = "CONFIG_DEBUG_INFO_BTF"
)

Variables

This section is empty.

Functions

func GetCgroupIdFromPath

func GetCgroupIdFromPath(cgroupPath string) (uint64, error)

GetCgroupIdFromPath returns the cgroup ID for the given cgroup v2 path. The cgroup ID is obtained via the file handle of the cgroup directory, which matches the value returned by bpf_get_current_cgroup_id() in eBPF programs. Returns 0 if cgroupPath is empty.

func GetSystemConfig

func GetSystemConfig() (map[string]string, error)

func IsContainer

func IsContainer() (bool, error)

IsContainer returns true if the process is running in a container.

func IsEnableBPF

func IsEnableBPF() (bool, error)

IsEnableBPF check BPF CONFIG

func IsEnableBTF

func IsEnableBTF() (bool, error)

func PrepareInsnPatchers

func PrepareInsnPatchers(m *manager.Manager, ebpfFuncs []string, pcapFilter string) []manager.InstructionPatcherFunc

PrepareInsnPatchers prepares instruction patcher functions for the given eBPF functions and pcap filter. This stub returns an empty list; pcap filtering is only available when built with -tags dynamic.

Types

type UnameInfo

type UnameInfo struct {
	SysName    string
	Nodename   string
	Release    string
	Version    string
	Machine    string
	Domainname string
}

Jump to

Keyboard shortcuts

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