@@ -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)) {
/*
@@ -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 */