Documentation
¶
Overview ¶
Package inject provides types and functionality to extract offset information from target ELF and inject that data into eBPF probes.
Index ¶
- func Constants(spec *ebpf.CollectionSpec, opts ...Option) error
- func FindOffset(id structfield.ID, info *process.Info) (structfield.OffsetKey, error)
- func GetLatestOffset(id structfield.ID) (structfield.OffsetKey, *semver.Version)
- func GetOffset(id structfield.ID, ver *semver.Version) (structfield.OffsetKey, bool)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Constants ¶ added in v0.20.0
func Constants(spec *ebpf.CollectionSpec, opts ...Option) error
Constants injects key-values defined by opts into spec as constant. The keys are used as volatile const names and the values are the const values.
If duplicate or colliding Options are passed, the last one passed is used.
func FindOffset ¶ added in v0.20.0
func FindOffset(id structfield.ID, info *process.Info) (structfield.OffsetKey, error)
func GetLatestOffset ¶ added in v0.20.0
func GetLatestOffset(id structfield.ID) (structfield.OffsetKey, *semver.Version)
func GetOffset ¶ added in v0.20.0
func GetOffset(id structfield.ID, ver *semver.Version) (structfield.OffsetKey, bool)
Types ¶
type Option ¶ added in v0.20.0
type Option interface {
// contains filtered or unexported methods
}
Option configures key-values to be injected into an ebpf.CollectionSpec.
func WithAllocation ¶ added in v0.22.0
func WithAllocation(alloc process.Allocation) Option
WithAllocation returns an option that will set "total_cpus", "start_addr", and "end_addr".
func WithKeyValue ¶ added in v0.20.0
WithKeyValue returns an option that will set key to value.
func WithOffset ¶ added in v0.20.0
func WithOffset(key string, id structfield.ID, ver *semver.Version) Option
WithOffset returns an option that sets key to the offset value of the struct field defined by id at the specified version ver.
If the offset value is not known, an error is returned when the returned Option is used.