Re: [PATCH 21/22] trace, pcie, aer: trace_aer_irq to trace receipt of AER message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I guess we might need some mechanisms to associate aer_record events
with aer_irq event if the next aer interrupt can happen before the
DPC work traces the previous aer_record. What do you think about that?

Thanks,
Kenji Kaneshige



Hidetoshi Seto wrote:
The event aer_record is generated after receiving an error
message by a rootport's ISR, kicking a DPC work by the ISR,
and investigating devices in the hierarchy under the rootport
by the DPC work.

This patch adds an event aer_irq to tell the receipt of error
message submitted to root port.  This could be used to probe
what behavior of system/driver tends to cause/generate the
error message.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
---
 drivers/pci/pcie/aer/aerdrv.c   |    5 +++++
 include/trace/events/pcie_aer.h |   25 +++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c
index 0612bd9..9853993 100644
--- a/drivers/pci/pcie/aer/aerdrv.c
+++ b/drivers/pci/pcie/aer/aerdrv.c
@@ -29,6 +29,8 @@
 #include "aerdrv.h"
 #include "../../pci.h"
+#include <trace/events/pcie_aer.h>
+
 /*
  * Version Information
  */
@@ -133,6 +135,9 @@ irqreturn_t aer_irq(int irq, void *context)
 	pci_read_config_dword(pdev->port, pos + PCI_ERR_ROOT_ERR_SRC, &id);
 	pci_write_config_dword(pdev->port, pos + PCI_ERR_ROOT_STATUS, status);
+ /* Emit the trace record */
+	trace_aer_irq(pdev->port, status, id);
+
 	/* Store error source for later DPC handler */
 	if (!set_e_source(rpc, status, id)) {
 		/*
diff --git a/include/trace/events/pcie_aer.h b/include/trace/events/pcie_aer.h
index d1d6497..aceb6d7 100644
--- a/include/trace/events/pcie_aer.h
+++ b/include/trace/events/pcie_aer.h
@@ -62,6 +62,31 @@ TRACE_EVENT(aer_record,
 	)
 );
+TRACE_EVENT(aer_irq,
+
+	TP_PROTO(struct pci_dev *pdev, int status, int id),
+
+	TP_ARGS(pdev, status, id),
+
+	TP_STRUCT__entry(
+		__field(	u32,	status		)
+		__field(	u32,	id		)
+		__string(	dstr,	dev_driver_string(&pdev->dev)	)
+		__string(	name,	dev_name(&pdev->dev)		)
+	),
+
+	TP_fast_assign(
+		__entry->status	= status;
+		__entry->id	= id;
+		__assign_str(dstr, dev_driver_string(&pdev->dev));
+		__assign_str(name, dev_name(&pdev->dev));
+	),
+
+	TP_printk("%s %s: status=%08xh, id=%08xh",
+		__get_str(dstr), __get_str(name), __entry->status, __entry->id
+	)
+);
+
 #endif /* _TRACE_PCIE_AER_H */
/* This part must be outside protection */


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux