diff mbox

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

Message ID 4BBC36CC.3000709@jp.fujitsu.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Hidetoshi Seto April 7, 2010, 7:39 a.m. UTC
None
diff mbox

Patch

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 */