iptrace

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MapName is the name of the map.
	MapName = "cilium_percpu_trace_id"

	// MaxEntries represents the maximum number of trace ID entries.
	MaxEntries = 1
)

Variables

View Source
var Cell = cell.Module(
	"iptrace-map",
	"eBPF map for IP tracing",

	cell.Provide(
		func(lc cell.Lifecycle) bpf.MapOut[*ipTraceMap] {
			m := NewMap()
			lc.Append(cell.Hook{
				OnStart: func(startCtx cell.HookContext) error {
					return m.OpenOrCreate()
				},
				OnStop: func(stopCtx cell.HookContext) error {
					return m.Close()
				},
			})
			return bpf.NewMapOut(m)
		},
	),
)

Cell provides the PerCPUTraceMap, which is an eBPF map used for IP tracing. This map is designed to store trace IDs on a per-CPU basis, allowing for efficient and concurrent tracing of IP packets. The map has a maximum of one entry, which is used to store the trace ID for the current CPU.

Functions

func NewMap

func NewMap() *ipTraceMap

NewMap returns a new trace map.

Types

type Key

type Key uint32

Key is the key for the IP trace map.

func (*Key) New

func (k *Key) New() bpf.MapKey

New creates a new key.

func (*Key) String

func (k *Key) String() string

String returns the string representation of the key.

type TraceId

type TraceId uint64

TraceId is the value for the IP trace map.

func (*TraceId) New

func (v *TraceId) New() bpf.MapValue

New creates a new value.

func (*TraceId) String

func (v *TraceId) String() string

String returns the string representation of the value.

Jump to

Keyboard shortcuts

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