]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: trace: Add generic RAS tracepoint for hotplug event
authorShuai Xue <xueshuai@linux.alibaba.com>
Wed, 10 Dec 2025 13:29:05 +0000 (21:29 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Dec 2025 22:05:56 +0000 (16:05 -0600)
commit9e541b3cee70a3bbe86b176c903c23b29fe033cd
treec985d3ab98983e41faff86d88e8a8565c2d803e1
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
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

Suggested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> # for trace event
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20251210132907.58799-2-xueshuai@linux.alibaba.com
drivers/pci/Makefile
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/trace.c [new file with mode: 0644]
include/trace/events/pci.h [new file with mode: 0644]
include/uapi/linux/pci.h