inject

package
v0.12.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Constants

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.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures key-values to be injected into an ebpf.CollectionSpec.

func WithAllocationDetails

func WithAllocationDetails(details process.AllocationDetails) Option

WithAllocationDetails returns an option that will set "total_cpus", "start_addr", and "end_addr".

func WithKeyValue

func WithKeyValue(key string, value interface{}) Option

WithKeyValue returns an option that will set key to value.

func WithOffset

func WithOffset(key string, id structfield.ID, ver *version.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.

func WithRegistersABI

func WithRegistersABI(value bool) Option

WithRegistersABI returns an option that will set the "is_registers_abi" to value. This information can be determined from the IsRegistersABI method of the TargetDetails in "go.opentelemetry.io/auto/internal/pkg/process".

Commonly this is called like the following:

WithRegistersABI(target.IsRegistersABI())

Jump to

Keyboard shortcuts

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