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
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -39,4 +39,11 @@ · 38 unmodified lines | |||
| 39 | #define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */ | 39 | #define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */ |
| 40 | #define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */ | 40 | #define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */ |
| 41 | 41 | ||
| 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 | |||
| 42 | #endif /* _UAPILINUX_PCI_H */ | 49 | #endif /* _UAPILINUX_PCI_H */ |