events

package
v0.0.0-...-01651d8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	HW_ERR_MCE       = 0
	HW_ERR_EDAC      = 1
	HW_ERR_ACPI_GHES = 2
	HW_ERR_PCIE_AER  = 3
	HW_ERR_THR       = 4 // MCE threshold (local-APIC) interrupt
	HW_ERR_ARM_GHES  = 5 // ARM processor error section (CPER §N.2.4.4, arm64 only)
)

Hardware error type identifiers — must stay in sync with bpf/system_ras.c.

View Source
const (
	ErrTypeCorrected              = "Corrected"
	ErrTypeUncorrectedRecoverable = "UncorrectedRecoverable"
	ErrTypeUncorrectedDeferred    = "UncorrectedDeferred"
	ErrTypeUncorrectedFatal       = "UncorrectedFatal"
	ErrTypeInfo                   = "Info"
	ErrTypeUnknown                = "unknown"
)

Error severity labels written into RasTracingData.ErrType.

View Source
const (
	RAS_PERFEVENT_INFO_SIZE = len(abi.RASEvent{}.Info)
	DETAIL_INFO_SIZE_EDAC   = RAS_PERFEVENT_INFO_SIZE - 60
	DETAIL_INFO_SIZE_ACPI   = RAS_PERFEVENT_INFO_SIZE - 56
	DETAIL_INFO_SIZE_AER    = RAS_PERFEVENT_INFO_SIZE - 36
)

The dynamic_array info always lives at the very end of each tracepoint event struct. We read the full 512-byte buffer so the kernel never needs to truncate the payload.

Fixed-portion byte counts (the static fields, excluding the 4-byte __data_loc field that precedes the dynamic area):

trace_event_raw_mc_event:           64 − 4 = 60
trace_event_raw_non_standard_event: 60 − 4 = 56
trace_event_raw_aer_event:          40 − 4 = 36
View Source
const (
	MCI_STATUS_DEFERRED = 1 << 44
	MCI_STATUS_UC       = 1 << 61
)
View Source
const (
	PciErrCorRcvr     uint32 = 0x00000001 /* Receiver Error */
	PciErrCorBadTlp   uint32 = 0x00000040 /* Bad TLP */
	PciErrCorBadDllp  uint32 = 0x00000080 /* Bad DLLP */
	PciErrCorRepRoll  uint32 = 0x00000100 /* REPLAY_NUM Rollover */
	PciErrCorRepTimer uint32 = 0x00001000 /* Replay Timer Timeout */
	PciErrCorAdvNfat  uint32 = 0x00002000 /* Advisory Non-Fatal */
	PciErrCorInternal uint32 = 0x00004000 /* Corrected Internal */
	PciErrCorLogOver  uint32 = 0x00008000 /* Header Log Overflow */
)

Correctable error status bits.

View Source
const (
	PciErrUncUnd       uint32 = 0x00000001 /* Undefined */
	PciErrUncDlp       uint32 = 0x00000010 /* Data Link Protocol */
	PciErrUncSurpdn    uint32 = 0x00000020 /* Surprise Down */
	PciErrUncPoisonTlp uint32 = 0x00001000 /* Poisoned TLP */
	PciErrUncFcp       uint32 = 0x00002000 /* Flow Control Protocol */
	PciErrUncCompTime  uint32 = 0x00004000 /* Completion Timeout */
	PciErrUncCompAbort uint32 = 0x00008000 /* Completer Abort */
	PciErrUncUnxComp   uint32 = 0x00010000 /* Unexpected Completion */
	PciErrUncRxOver    uint32 = 0x00020000 /* Receiver Overflow */
	PciErrUncMalfTlp   uint32 = 0x00040000 /* Malformed TLP */
	PciErrUncEcrc      uint32 = 0x00080000 /* ECRC Error */
	PciErrUncUnsup     uint32 = 0x00100000 /* Unsupported Request */
	PciErrUncAscv      uint32 = 0x00200000 /* ACS Violation */
	PciErrUncIntn      uint32 = 0x00400000 /* Uncorrectable Internal */
	PciErrUncMcptlp    uint32 = 0x00800000 /* MC Blocked TLP */
	PciErrUncAtomeg    uint32 = 0x01000000 /* AtomicOp Egress Blocked */
	PciErrUncTlpPre    uint32 = 0x02000000 /* TLP Prefix Blocked */
)

Uncorrectable error status bits.

Variables

This section is empty.

Functions

func Set

func Set(c *Config)

Set atomically publishes an immutable copy of the events config. A nil argument resets it to the zero value.

Types

type Config

type Config struct {
	SchedTick struct {
		// 10ms
		IntervalThreshold uint64 `default:"10000000"`
	}

	MemoryReclaim struct {
		// 900ms
		BlockedThreshold uint64 `default:"900000000"`
	}

	NetRxLatency struct {
		Driver2NetRx             uint64 `default:"5"`
		Driver2TCP               uint64 `default:"10"`
		Driver2Userspace         uint64 `default:"115"`
		ExcludedHostNetnamespace bool   `default:"true"`
		ExcludedContainerQos     []string
	}

	Dropwatch struct {
		Filter             string `default:"tcp"`
		MaxEventsPerSecond uint64 `default:"100"`
		ExcludeContainers  []string
	}

	TCPRetransmit struct {
		Filter                     string `default:""`
		EnableTLP                  bool   `default:"false"`
		EnableDropwatchCorrelation bool   `default:"false"`
		MaxEventsPerSecond         uint64 `default:"100"`
	}

	Netdev struct {
		DeviceList []string
	}

	Ras struct {
		MceThrBackoff int64 `default:"1800"`
	}

	IssuesList [][]string
}

Config holds event tracing configuration.

func (*Config) Clone

func (c *Config) Clone() *Config

Clone returns a deep copy suitable for immutable publication.

func (*Config) Validate

func (c *Config) Validate() error

Validate rejects invalid event tracing settings.

type HungTaskTracerData

type HungTaskTracerData struct {
	TID                   uint32 `json:"tid"`
	Comm                  string `json:"comm"`
	CPUsStack             string `json:"cpus_stack"`
	BlockedProcessesStack string `json:"blocked_processes_stack"`
	HungTaskTimeoutSecs   int    `json:"hung_task_timeout_secs"`
}

HungTaskTracerData is the full data structure.

type MemoryReclaimTracingData

type MemoryReclaimTracingData struct {
	PID               uint32 `json:"pid"`
	TID               uint32 `json:"tid"`
	Comm              string `json:"comm"`
	ReclaimDurationNS uint64 `json:"reclaim_duration_ns"`
}

MemoryReclaimTracingData is the full data structure.

type NetTracingData

type NetTracingData struct {
	Comm               string  `json:"comm"`
	PID                uint64  `json:"pid"`
	LatencyStage       string  `json:"latency_stage"`
	LatencyMS          float64 `json:"latency_ms"`
	LatencyThresholdMS uint64  `json:"latency_threshold_ms"`
	NetdevName         string  `json:"netdev_name"`
	NetNamespaceInum   uint32  `json:"net_namespace_inum"`
	NetNamespaceCookie uint64  `json:"net_namespace_cookie"`
	TCPState           string  `json:"tcp_state"`
	TCPSaddr           string  `json:"tcp_saddr"`
	TCPDaddr           string  `json:"tcp_daddr"`
	TCPSport           uint16  `json:"tcp_sport"`
	TCPDport           uint16  `json:"tcp_dport"`
	TCPSeq             uint32  `json:"tcp_seq"`
	TCPAckSeq          uint32  `json:"tcp_ack_seq"`
	PacketLenBytes     uint64  `json:"packet_len_bytes"`
}

NetTracingData is the full data structure.

type OOMActor

type OOMActor struct {
	MemoryCgroupCSSAddr string                   `json:"memory_cgroup_css_addr"`
	ContainerID         string                   `json:"container_id,omitempty"`
	ContainerHostname   string                   `json:"container_hostname,omitempty"`
	PID                 uint32                   `json:"pid"`
	Comm                string                   `json:"comm"`
	Cgroup              *OOMCgroupMemorySnapshot `json:"cgroup,omitempty"`
}

type OOMCgroupMemorySnapshot

type OOMCgroupMemorySnapshot struct {
	Path    string            `json:"path,omitempty"`
	Current uint64            `json:"current,omitempty"`
	Max     uint64            `json:"max,omitempty"`
	Stat    map[string]uint64 `json:"stat,omitempty"`
	Events  map[string]uint64 `json:"events,omitempty"`
}

type OOMMemorySnapshot

type OOMMemorySnapshot struct {
	HostMemInfo map[string]uint64 `json:"host_meminfo,omitempty"`
}

type OOMTracingData

type OOMTracingData struct {
	Trigger        OOMActor           `json:"trigger"`
	Victim         OOMActor           `json:"victim"`
	MemorySnapshot *OOMMemorySnapshot `json:"memory_snapshot,omitempty"`
}

type RasTracingData

type RasTracingData struct {
	Device  string `json:"dev"`
	Event   string `json:"event"`
	ErrType string `json:"type"`
	Info    string `json:"info"`
	// contains filtered or unexported fields
}

RasTracingData is the structured record persisted by tracing.Save.

type SchedTickTracingData

type SchedTickTracingData struct {
	TickIntervalNS          uint64 `json:"tick_interval_ns"`
	TickIntervalThresholdNS uint64 `json:"tick_interval_threshold_ns"`
	Comm                    string `json:"comm"`
	PID                     uint32 `json:"pid"`
	CPU                     uint32 `json:"cpu"`
	Stack                   string `json:"stack"`
}

SchedTickTracingData is the full scheduler tick tracing record.

type SoftLockupTracerData

type SoftLockupTracerData struct {
	CPU       uint32 `json:"cpu"`
	PID       uint32 `json:"pid"`
	Comm      string `json:"comm"`
	CPUsStack string `json:"cpus_stack"`
}

TracerData is the full data structure.

Jump to

Keyboard shortcuts

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