Skip to content

Commit 8236fc6

Browse files
axiqiabjorn-helgaas
authored andcommitted
Documentation: tracing: Add PCI tracepoint documentation
The PCI tracing system provides tracepoints to monitor critical hardware events that can impact system performance and reliability. Add documentation about it. Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com> [bhelgaas: squash fixes: https://lore.kernel.org/r/20260108013956.14351-2-bagasdotme@gmail.com https://lore.kernel.org/r/20260108013956.14351-3-bagasdotme@gmail.com] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251210132907.58799-4-xueshuai@linux.alibaba.com
1 parent d4318c1 commit 8236fc6

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

Documentation/trace/events-pci.rst

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
===========================
4+
Subsystem Trace Points: PCI
5+
===========================
6+
7+
Overview
8+
========
9+
The PCI tracing system provides tracepoints to monitor critical hardware events
10+
that can impact system performance and reliability. These events normally show
11+
up here:
12+
13+
/sys/kernel/tracing/events/pci
14+
15+
Cf. include/trace/events/pci.h for the events definitions.
16+
17+
Available Tracepoints
18+
=====================
19+
20+
pci_hp_event
21+
------------
22+
23+
Monitors PCI hotplug events including card insertion/removal and link
24+
state changes.
25+
::
26+
27+
pci_hp_event "%s slot:%s, event:%s\n"
28+
29+
**Event Types**:
30+
31+
* ``LINK_UP`` - PCIe link established
32+
* ``LINK_DOWN`` - PCIe link lost
33+
* ``CARD_PRESENT`` - Card detected in slot
34+
* ``CARD_NOT_PRESENT`` - Card removed from slot
35+
36+
**Example Usage**::
37+
38+
# Enable the tracepoint
39+
echo 1 > /sys/kernel/debug/tracing/events/pci/pci_hp_event/enable
40+
41+
# Monitor events (the following output is generated when a device is hotplugged)
42+
cat /sys/kernel/debug/tracing/trace_pipe
43+
irq/51-pciehp-88 [001] ..... 1311.177459: pci_hp_event: 0000:00:02.0 slot:10, event:CARD_PRESENT
44+
45+
irq/51-pciehp-88 [001] ..... 1311.177566: pci_hp_event: 0000:00:02.0 slot:10, event:LINK_UP
46+
47+
pcie_link_event
48+
---------------
49+
50+
Monitors PCIe link speed changes and provides detailed link status information.
51+
::
52+
53+
pcie_link_event "%s type:%d, reason:%d, cur_bus_speed:%d, max_bus_speed:%d, width:%u, flit_mode:%u, status:%s\n"
54+
55+
**Parameters**:
56+
57+
* ``type`` - PCIe device type (4=Root Port, etc.)
58+
* ``reason`` - Reason for link change:
59+
60+
- ``0`` - Link retrain
61+
- ``1`` - Bus enumeration
62+
- ``2`` - Bandwidth notification enable
63+
- ``3`` - Bandwidth notification IRQ
64+
- ``4`` - Hotplug event
65+
66+
67+
**Example Usage**::
68+
69+
# Enable the tracepoint
70+
echo 1 > /sys/kernel/debug/tracing/events/pci/pcie_link_event/enable
71+
72+
# Monitor events (the following output is generated when a device is hotplugged)
73+
cat /sys/kernel/debug/tracing/trace_pipe
74+
irq/51-pciehp-88 [001] ..... 381.545386: pcie_link_event: 0000:00:02.0 type:4, reason:4, cur_bus_speed:20, max_bus_speed:23, width:1, flit_mode:0, status:DLLLA

Documentation/trace/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ applications.
5454
events-power
5555
events-nmi
5656
events-msr
57+
events-pci
5758
boottime-trace
5859
histogram
5960
histogram-design

0 commit comments

Comments
 (0)