mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 03:11:11 -04:00
PCI: trace: Add PCI controller tracepoint feature
Some PCI controllers may provide debug functionalities to track PCI bus activities like LTSSM state transitions and data rate changes. These will be very useful for debugging PCI link specific issues such as endpoint not getting detected or performance issues. Hence, implement the PCI controller tracepoint feature for recording LTSSM state transitions and data rate changes. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> [mani: commit log and maintainers entry] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Tested-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Link: https://patch.msgid.link/1774403912-210670-2-git-send-email-shawn.lin@rock-chips.com
This commit is contained in:
committed by
Manivannan Sadhasivam
parent
6de23f81a5
commit
d1b7add89c
@@ -20399,6 +20399,7 @@ F: Documentation/devicetree/bindings/pci/
|
||||
F: drivers/pci/controller/
|
||||
F: drivers/pci/pci-bridge-emul.c
|
||||
F: drivers/pci/pci-bridge-emul.h
|
||||
F: include/trace/events/pci_controller.h
|
||||
|
||||
PCI PEER-TO-PEER DMA (P2PDMA)
|
||||
M: Bjorn Helgaas <bhelgaas@google.com>
|
||||
|
||||
@@ -9,3 +9,4 @@
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/pci.h>
|
||||
#include <trace/events/pci_controller.h>
|
||||
|
||||
58
include/trace/events/pci_controller.h
Normal file
58
include/trace/events/pci_controller.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM pci_controller
|
||||
|
||||
#if !defined(_TRACE_HW_EVENT_PCI_CONTROLLER_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HW_EVENT_PCI_CONTROLLER_H
|
||||
|
||||
#include <uapi/linux/pci_regs.h>
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#define RATE \
|
||||
EM(PCIE_SPEED_2_5GT, "2.5 GT/s") \
|
||||
EM(PCIE_SPEED_5_0GT, "5.0 GT/s") \
|
||||
EM(PCIE_SPEED_8_0GT, "8.0 GT/s") \
|
||||
EM(PCIE_SPEED_16_0GT, "16.0 GT/s") \
|
||||
EM(PCIE_SPEED_32_0GT, "32.0 GT/s") \
|
||||
EM(PCIE_SPEED_64_0GT, "64.0 GT/s") \
|
||||
EMe(PCI_SPEED_UNKNOWN, "Unknown")
|
||||
|
||||
|
||||
#undef EM
|
||||
#undef EMe
|
||||
#define EM(a, b) TRACE_DEFINE_ENUM(a);
|
||||
#define EMe(a, b) TRACE_DEFINE_ENUM(a);
|
||||
|
||||
RATE
|
||||
|
||||
#undef EM
|
||||
#undef EMe
|
||||
#define EM(a, b) {a, b},
|
||||
#define EMe(a, b) {a, b}
|
||||
|
||||
TRACE_EVENT(pcie_ltssm_state_transition,
|
||||
TP_PROTO(const char *dev_name, const char *state, u32 rate),
|
||||
TP_ARGS(dev_name, state, rate),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string(dev_name, dev_name)
|
||||
__string(state, state)
|
||||
__field(u32, rate)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(dev_name);
|
||||
__assign_str(state);
|
||||
__entry->rate = rate;
|
||||
),
|
||||
|
||||
TP_printk("dev: %s state: %s rate: %s",
|
||||
__get_str(dev_name), __get_str(state),
|
||||
__print_symbolic(__entry->rate, RATE)
|
||||
)
|
||||
);
|
||||
|
||||
#endif /* _TRACE_HW_EVENT_PCI_CONTROLLER_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
Reference in New Issue
Block a user