History

PCI: trace: Add generic RAS tracepoint for hotplug event

Hotplug events are critical indicators for analyzing hardware health, and surprise link downs can significantly impact system performance and reliability. Define a new TRACING_SYSTEM named "pci", add a generic RAS tracepoint for hotplug event to help health checks. Add enum pci_hotplug_event in include/uapi/linux/pci.h so applications like rasdaemon can register tracepoint event handlers for it. The following output is generated when a device is hotplugged: $ echo 1 > /sys/kernel/debug/tracing/events/pci/pci_hp_event/enable $ cat /sys/kernel/debug/tracing/trace_pipe irq/51-pciehp-88 [001] ..... 1311.177459: pci_hp_event: 0000:00:02.0 slot:10, event:CARD_PRESENT irq/51-pciehp-88 [001] ..... 1311.177566: pci_hp_event: 0000:00:02.0 slot:10, event:LINK_UP

Shuai Xue committed 11 months ago

Commit 9e541b31 parent 8f0b4cc5 files · +118 −6Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/pci.h+7−0
@@ -39,4 +39,11 @@ · 38 unmodified lines
3939 #define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */
4040 #define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */
4141
42+enum pci_hotplug_event {
43+ PCI_HOTPLUG_LINK_UP,
44+ PCI_HOTPLUG_LINK_DOWN,
45+ PCI_HOTPLUG_CARD_PRESENT,
46+ PCI_HOTPLUG_CARD_NOT_PRESENT,
47+};
48+
4249 #endif /* _UAPILINUX_PCI_H */