diff options
| author | Chen, Gong <gong.chen@linux.intel.com> | 2014-06-17 22:33:07 -0400 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2014-06-25 16:26:47 -0400 |
| commit | 2dfb7d51a61d7ca91b131c8db612f27d9390f2d5 (patch) | |
| tree | b2e9375f1ffaf2dc93418d78c27b6a13b34c8e88 /include/ras | |
| parent | d963cd95bea93b7db9390a71d1e2cabbb3b2c3ea (diff) | |
trace, RAS: Add eMCA trace event interface
Add trace interface to elaborate all H/W error related information.
Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include/ras')
| -rw-r--r-- | include/ras/ras_event.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index acbcbb88eaaa..47da53c27ffa 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h | |||
| @@ -9,6 +9,70 @@ | |||
| 9 | #include <linux/edac.h> | 9 | #include <linux/edac.h> |
| 10 | #include <linux/ktime.h> | 10 | #include <linux/ktime.h> |
| 11 | #include <linux/aer.h> | 11 | #include <linux/aer.h> |
| 12 | #include <linux/cper.h> | ||
| 13 | |||
| 14 | /* | ||
| 15 | * MCE Extended Error Log trace event | ||
| 16 | * | ||
| 17 | * These events are generated when hardware detects a corrected or | ||
| 18 | * uncorrected event. | ||
| 19 | */ | ||
| 20 | |||
| 21 | /* memory trace event */ | ||
| 22 | |||
| 23 | #if defined(CONFIG_ACPI_EXTLOG) || defined(CONFIG_ACPI_EXTLOG_MODULE) | ||
| 24 | TRACE_EVENT(extlog_mem_event, | ||
| 25 | TP_PROTO(struct cper_sec_mem_err *mem, | ||
| 26 | u32 err_seq, | ||
| 27 | const uuid_le *fru_id, | ||
| 28 | const char *fru_text, | ||
| 29 | u8 sev), | ||
| 30 | |||
| 31 | TP_ARGS(mem, err_seq, fru_id, fru_text, sev), | ||
| 32 | |||
| 33 | TP_STRUCT__entry( | ||
| 34 | __field(u32, err_seq) | ||
| 35 | __field(u8, etype) | ||
| 36 | __field(u8, sev) | ||
| 37 | __field(u64, pa) | ||
| 38 | __field(u8, pa_mask_lsb) | ||
| 39 | __field_struct(uuid_le, fru_id) | ||
| 40 | __string(fru_text, fru_text) | ||
| 41 | __field_struct(struct cper_mem_err_compact, data) | ||
| 42 | ), | ||
| 43 | |||
| 44 | TP_fast_assign( | ||
| 45 | __entry->err_seq = err_seq; | ||
| 46 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_TYPE) | ||
| 47 | __entry->etype = mem->error_type; | ||
| 48 | else | ||
| 49 | __entry->etype = ~0; | ||
| 50 | __entry->sev = sev; | ||
| 51 | if (mem->validation_bits & CPER_MEM_VALID_PA) | ||
| 52 | __entry->pa = mem->physical_addr; | ||
| 53 | else | ||
| 54 | __entry->pa = ~0ull; | ||
| 55 | |||
| 56 | if (mem->validation_bits & CPER_MEM_VALID_PA_MASK) | ||
| 57 | __entry->pa_mask_lsb = (u8)__ffs64(mem->physical_addr_mask); | ||
| 58 | else | ||
| 59 | __entry->pa_mask_lsb = ~0; | ||
| 60 | __entry->fru_id = *fru_id; | ||
| 61 | __assign_str(fru_text, fru_text); | ||
| 62 | cper_mem_err_pack(mem, &__entry->data); | ||
| 63 | ), | ||
| 64 | |||
| 65 | TP_printk("{%d} %s error: %s physical addr: %016llx (mask lsb: %x) %sFRU: %pUl %.20s", | ||
| 66 | __entry->err_seq, | ||
| 67 | cper_severity_str(__entry->sev), | ||
| 68 | cper_mem_err_type_str(__entry->etype), | ||
| 69 | __entry->pa, | ||
| 70 | __entry->pa_mask_lsb, | ||
| 71 | cper_mem_err_unpack(p, &__entry->data), | ||
| 72 | &__entry->fru_id, | ||
| 73 | __get_str(fru_text)) | ||
| 74 | ); | ||
| 75 | #endif | ||
| 12 | 76 | ||
| 13 | /* | 77 | /* |
| 14 | * Hardware Events Report | 78 | * Hardware Events Report |
