ras.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM ras
  3. #if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_AER_H
  5. #include <linux/tracepoint.h>
  6. #include <linux/edac.h>
  7. /*
  8. * PCIe AER Trace event
  9. *
  10. * These events are generated when hardware detects a corrected or
  11. * uncorrected event on a PCIe device. The event report has
  12. * the following structure:
  13. *
  14. * char * dev_name - The name of the slot where the device resides
  15. * ([domain:]bus:device.function).
  16. * u32 status - Either the correctable or uncorrectable register
  17. * indicating what error or errors have been seen
  18. * u8 severity - error severity 0:NONFATAL 1:FATAL 2:CORRECTED
  19. */
  20. #define aer_correctable_errors \
  21. {BIT(0), "Receiver Error"}, \
  22. {BIT(6), "Bad TLP"}, \
  23. {BIT(7), "Bad DLLP"}, \
  24. {BIT(8), "RELAY_NUM Rollover"}, \
  25. {BIT(12), "Replay Timer Timeout"}, \
  26. {BIT(13), "Advisory Non-Fatal"}
  27. #define aer_uncorrectable_errors \
  28. {BIT(4), "Data Link Protocol"}, \
  29. {BIT(12), "Poisoned TLP"}, \
  30. {BIT(13), "Flow Control Protocol"}, \
  31. {BIT(14), "Completion Timeout"}, \
  32. {BIT(15), "Completer Abort"}, \
  33. {BIT(16), "Unexpected Completion"}, \
  34. {BIT(17), "Receiver Overflow"}, \
  35. {BIT(18), "Malformed TLP"}, \
  36. {BIT(19), "ECRC"}, \
  37. {BIT(20), "Unsupported Request"}
  38. TRACE_EVENT(aer_event,
  39. TP_PROTO(const char *dev_name,
  40. const u32 status,
  41. const u8 severity),
  42. TP_ARGS(dev_name, status, severity),
  43. TP_STRUCT__entry(
  44. __string( dev_name, dev_name )
  45. __field( u32, status )
  46. __field( u8, severity )
  47. ),
  48. TP_fast_assign(
  49. __assign_str(dev_name, dev_name);
  50. __entry->status = status;
  51. __entry->severity = severity;
  52. ),
  53. TP_printk("%s PCIe Bus Error: severity=%s, %s\n",
  54. __get_str(dev_name),
  55. __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" :
  56. __entry->severity == HW_EVENT_ERR_FATAL ?
  57. "Fatal" : "Uncorrected",
  58. __entry->severity == HW_EVENT_ERR_CORRECTED ?
  59. __print_flags(__entry->status, "|", aer_correctable_errors) :
  60. __print_flags(__entry->status, "|", aer_uncorrectable_errors))
  61. );
  62. #endif /* _TRACE_AER_H */
  63. /* This part must be outside protection */
  64. #include <trace/define_trace.h>