Documentation
¶
Overview ¶
Package ebpf contains general eBPF related types and functions
Index ¶
- Variables
- func AddIgnoredProgramID(id ebpf.ProgramID)
- func AddNameMappings(mgr *manager.Manager, module string)
- func AddNameMappingsCollection(coll *ebpf.Collection, module string)
- func AddNameMappingsForMap(m *ebpf.Map, name, module string)
- func AddNameMappingsForProgram(p *ebpf.Program, name, module string)
- func AddProbeFDMappings(mgr *manager.Manager)
- func AddProgramNameMapping(progid uint32, name string, module string)
- func ClearProgramIDMappings(module string)
- func GetBTFLoaderInfo() (string, error)
- func GetKernelSymbolsAddressesNoCache(ksymsReader io.Reader, ksyms ...string) (map[string]uint64, error)
- func GetMapNameFromMapID(id uint32) (string, error)
- func GetModuleFromMapID(id uint32) (string, error)
- func GetModuleFromProgID(id uint32) (string, error)
- func GetPerfEventFDByProbeID(probeID ebpf.ProgramID) (uint32, error)
- func GetProgNameFromProgID(id uint32) (string, error)
- func HandleBTFLoaderInfo(w http.ResponseWriter, _ *http.Request)
- func IsProgramIDIgnored(id ebpf.ProgramID) bool
- func NowNanoseconds() (int64, error)
- func PreprocessFile(bpfDir, fileName string) (*bytes.Buffer, error)
- func RemoveIgnoredProgramID(id ebpf.ProgramID)
- func RemoveNameMappings(mgr *manager.Manager)
- func RemoveNameMappingsCollection(coll *ebpf.Collection)
- func RemoveProgramID(progID uint32, expectedModule string)
- func ResetAllMappings()
- func VerifyKernelFuncs(requiredKernelFuncs ...string) (map[string]struct{}, error)
- type Config
- type ContentionData
- type LockContentionCollector
- type LockRange
- type LockType
Constants ¶
This section is empty.
Variables ¶
var (
// CIncludePattern is the regex for #include headers of C files
CIncludePattern = `^\s*#\s*include\s+"(.*)"$`
)
var ( // ErrNotImplemented will be returned on non-linux environments like Windows and Mac OSX ErrNotImplemented = errors.New("BPF-based system probe not implemented on non-linux systems") )
Functions ¶
func AddIgnoredProgramID ¶
AddIgnoredProgramID adds a program ID to the list of ignored programs
func AddNameMappings ¶
AddNameMappings adds the full name mappings for ebpf maps in the manager
func AddNameMappingsCollection ¶
func AddNameMappingsCollection(coll *ebpf.Collection, module string)
AddNameMappingsCollection adds the full name mappings for ebpf maps in the collection
func AddNameMappingsForMap ¶
AddNameMappingsForMap adds the full name mappings for the provided ebpf map
func AddNameMappingsForProgram ¶
AddNameMappingsForProgram adds the full name mappings for the provided ebpf program
func AddProbeFDMappings ¶
AddProbeFDMappings creates mappings between a program and its perf event fd
func AddProgramNameMapping ¶
AddProgramNameMapping manually adds a program name mapping
func ClearProgramIDMappings ¶
func ClearProgramIDMappings(module string)
ClearProgramIDMappings clears all name mappings for a given module
func GetBTFLoaderInfo ¶
GetBTFLoaderInfo is not supported without linux_bpf
func GetKernelSymbolsAddressesNoCache ¶
func GetKernelSymbolsAddressesNoCache(ksymsReader io.Reader, ksyms ...string) (map[string]uint64, error)
GetKernelSymbolsAddressesNoCache returns the requested kernel symbols and addresses without using the cache It expects a reader from which to read the kernel symbols.
func GetMapNameFromMapID ¶
GetMapNameFromMapID returns the map name for the given id
func GetModuleFromMapID ¶
GetModuleFromMapID returns the module name for the map with the given id
func GetModuleFromProgID ¶
GetModuleFromProgID returns the module name for the program with the given id
func GetPerfEventFDByProbeID ¶
GetPerfEventFDByProbeID returns the fd mapped for a probe or an error if no mappings exists
func GetProgNameFromProgID ¶
GetProgNameFromProgID returns the program name for the given id
func HandleBTFLoaderInfo ¶
func HandleBTFLoaderInfo(w http.ResponseWriter, _ *http.Request)
HandleBTFLoaderInfo responds with where the system-probe found BTF data (and if it was in a pre-bundled tarball, where within that tarball it came from)
func IsProgramIDIgnored ¶
IsProgramIDIgnored returns true if this program ID should be ignored
func NowNanoseconds ¶ added in v0.9.0
NowNanoseconds returns a time that can be compared to bpf_ktime_get_ns()
func PreprocessFile ¶ added in v0.9.0
PreprocessFile pre-processes the `#include` of embedded headers. It will only replace top-level includes for files that exist and does not evaluate the content of included files for #include directives.
func RemoveIgnoredProgramID ¶
RemoveIgnoredProgramID removes a program ID from the list of ignored programs
func RemoveNameMappings ¶
RemoveNameMappings removes the full name mappings for ebpf maps in the manager
func RemoveNameMappingsCollection ¶
func RemoveNameMappingsCollection(coll *ebpf.Collection)
RemoveNameMappingsCollection removes the full name mappings for ebpf maps in the collection
func RemoveProgramID ¶
RemoveProgramID manually removes a program name mapping
func ResetAllMappings ¶
func ResetAllMappings()
ResetAllMappings removes all mappings. This is useful in tests to reset state
func VerifyKernelFuncs ¶ added in v0.9.0
VerifyKernelFuncs ensures all kernel functions exist in ksyms located at provided path.
Types ¶
type Config ¶
type Config struct {
// BPFDebug enables bpf debug logs
BPFDebug bool
// BPFDir is the directory to load the eBPF program from
BPFDir string
// ExcludedBPFLinuxVersions lists Linux kernel versions that should not use BPF features
ExcludedBPFLinuxVersions []string
// ProcRoot is the root path to the proc filesystem
ProcRoot string
// InternalTelemetryEnabled indicates whether internal prometheus telemetry is enabled
InternalTelemetryEnabled bool
// EnableTracepoints enables use of tracepoints instead of kprobes for probing syscalls (if available on system)
EnableTracepoints bool
// EnableCORE enables the use of CO-RE to load eBPF programs
EnableCORE bool
// BTFPath is the path to BTF data for the current kernel
BTFPath string
// EnableRuntimeCompiler enables the use of the embedded compiler to build eBPF programs on-host
EnableRuntimeCompiler bool
// EnableKernelHeaderDownload enables the use of the automatic kernel header downloading
EnableKernelHeaderDownload bool
// KernelHeadersDir is the directories of the kernel headers to use for runtime compilation
KernelHeadersDirs []string
// KernelHeadersDownloadDir is the directory where the system-probe will attempt to download kernel headers, if necessary
KernelHeadersDownloadDir string
// RuntimeCompilerOutputDir is the directory where the runtime compiler will store compiled programs
RuntimeCompilerOutputDir string
// BTFOutputDir is the directory where extracted BTF files are stored
BTFOutputDir string
// AptConfigDir is the path to the apt config directory
AptConfigDir string
// YumReposDir is the path to the yum repository directory
YumReposDir string
// ZypperReposDir is the path to the zypper repository directory
ZypperReposDir string
// AllowPrebuiltFallback indicates whether we are allowed to fallback to the prebuilt probes if runtime compilation fails.
AllowPrebuiltFallback bool
// AllowRuntimeCompiledFallback indicates whether we are allowed to fallback to runtime compilation if CO-RE fails.
AllowRuntimeCompiledFallback bool
// AttachKprobesWithKprobeEventsABI uses the kprobe_events ABI to attach kprobes rather than the newer perf ABI.
AttachKprobesWithKprobeEventsABI bool
// BypassEnabled is used in tests only.
// It enables a ebpf-manager feature to bypass programs on-demand for controlled visibility.
BypassEnabled bool
// RemoteConfigBTFEnabled indicates whether we can use remote config to obtain BTF
RemoteConfigBTFEnabled bool
// RemoteConfigBTFTimeout is how long we will wait for BTF information from remote config
RemoteConfigBTFTimeout time.Duration
// RemoteConfigBTFDownloadHost is the base URL host for downloading BTF from remote config
RemoteConfigBTFDownloadHost string
}
Config stores all common flags used by system-probe
type ContentionData ¶
type LockContentionCollector ¶
type LockContentionCollector struct{}
LockContentionCollector is just a placeholder
func NewLockContentionCollector ¶
func NewLockContentionCollector() *LockContentionCollector
NewLockContentionCollector returns nil
func (*LockContentionCollector) Collect ¶
func (l *LockContentionCollector) Collect(_ chan<- prometheus.Metric)
Collect does nothing
func (*LockContentionCollector) Describe ¶
func (l *LockContentionCollector) Describe(_ chan<- *prometheus.Desc)
Describe does nothing
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bytecode contains types and functions for eBPF bytecode
|
Package bytecode contains types and functions for eBPF bytecode |
|
Package main is the program to fixup cgo generated types
|
Package main is the program to fixup cgo generated types |
|
Package ebpftest is utilities for tests against eBPF
|
Package ebpftest is utilities for tests against eBPF |
|
Package kernelbugs provides runtime detection for kernel bugs effecting system-probe
|
Package kernelbugs provides runtime detection for kernel bugs effecting system-probe |
|
Package prebuilt implements prebuilt specific eBPF functionality
|
Package prebuilt implements prebuilt specific eBPF functionality |
|
Package telemetry provides types and functions for kernel telemetry collected by eBPF programs.
|
Package telemetry provides types and functions for kernel telemetry collected by eBPF programs. |
|
Package uprobes contains methods to help handling the attachment of uprobes to userspace programs
|
Package uprobes contains methods to help handling the attachment of uprobes to userspace programs |
|
Package verifier is responsible for exposing information the verifier provides for any loaded eBPF program
|
Package verifier is responsible for exposing information the verifier provides for any loaded eBPF program |