dmesg

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// e.g.,
	// [...] NVRM: Xid (0000:03:00): 14, Channel 00000001
	// [...] NVRM: Xid (PCI:0000:05:00): 79, pid='<unknown>', name=<unknown>, GPU has fallen off the bus.
	// NVRM: Xid (PCI:0000:01:00): 79, GPU has fallen off the bus.
	//
	// ref.
	// https://docs.nvidia.com/deploy/pdf/XID_Errors.pdf
	RegexNVRMXidDmesg = `NVRM: Xid.*?: (\d+),`

	// Regex to extract PCI device ID from NVRM Xid messages
	// Matches both formats: (0000:03:00) and (PCI:0000:05:00)
	RegexNVRMXidDeviceUUID = `NVRM: Xid \(((?:PCI:)?[0-9a-fA-F:]+)\)`
)

Variables

This section is empty.

Functions

func ExtractNVRMXid

func ExtractNVRMXid(line string) int

Extracts the nvidia Xid error code from the dmesg log line. Returns 0 if the error code is not found. https://docs.nvidia.com/deploy/pdf/XID_Errors.pdf

func ExtractNVRMXidDeviceUUID

func ExtractNVRMXidDeviceUUID(line string) string

ExtractNVRMXidDeviceUUID extracts the PCI device ID from the NVRM Xid dmesg log line. For input without "PCI:" prefix, it returns the ID as is. For input with "PCI:" prefix, it returns the full ID including the prefix. Returns empty string if the device ID is not found.

Types

type XidError

type XidError struct {
	Xid        int         `json:"xid"`
	DeviceUUID string      `json:"device_uuid"`
	Detail     *xid.Detail `json:"detail,omitempty"`
}

func Match

func Match(line string) *XidError

Returns a matching xid error object if found. Otherwise, returns nil.

Jump to

Keyboard shortcuts

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