Mauro Carvalho Chehab | 53f2d02 | 2012-02-23 08:10:34 -0300 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM ras |
| 3 | #define TRACE_INCLUDE_FILE ras_event |
| 4 | |
| 5 | #if !defined(_TRACE_HW_EVENT_MC_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_HW_EVENT_MC_H |
| 7 | |
| 8 | #include <linux/tracepoint.h> |
| 9 | #include <linux/edac.h> |
| 10 | #include <linux/ktime.h> |
| 11 | |
| 12 | /* |
| 13 | * Hardware Events Report |
| 14 | * |
| 15 | * Those events are generated when hardware detected a corrected or |
| 16 | * uncorrected event, and are meant to replace the current API to report |
| 17 | * errors defined on both EDAC and MCE subsystems. |
| 18 | * |
| 19 | * FIXME: Add events for handling memory errors originated from the |
| 20 | * MCE subsystem. |
| 21 | */ |
| 22 | |
| 23 | /* |
| 24 | * Hardware-independent Memory Controller specific events |
| 25 | */ |
| 26 | |
| 27 | /* |
| 28 | * Default error mechanisms for Memory Controller errors (CE and UE) |
| 29 | */ |
| 30 | TRACE_EVENT(mc_event, |
| 31 | |
| 32 | TP_PROTO(const unsigned int err_type, |
| 33 | const char *error_msg, |
| 34 | const char *label, |
| 35 | const int error_count, |
| 36 | const u8 mc_index, |
| 37 | const s8 top_layer, |
| 38 | const s8 mid_layer, |
| 39 | const s8 low_layer, |
| 40 | unsigned long address, |
| 41 | const u8 grain_bits, |
| 42 | unsigned long syndrome, |
| 43 | const char *driver_detail), |
| 44 | |
| 45 | TP_ARGS(err_type, error_msg, label, error_count, mc_index, |
| 46 | top_layer, mid_layer, low_layer, address, grain_bits, |
| 47 | syndrome, driver_detail), |
| 48 | |
| 49 | TP_STRUCT__entry( |
| 50 | __field( unsigned int, error_type ) |
| 51 | __string( msg, error_msg ) |
| 52 | __string( label, label ) |
| 53 | __field( u16, error_count ) |
| 54 | __field( u8, mc_index ) |
| 55 | __field( s8, top_layer ) |
| 56 | __field( s8, middle_layer ) |
| 57 | __field( s8, lower_layer ) |
| 58 | __field( long, address ) |
| 59 | __field( u8, grain_bits ) |
| 60 | __field( long, syndrome ) |
| 61 | __string( driver_detail, driver_detail ) |
| 62 | ), |
| 63 | |
| 64 | TP_fast_assign( |
| 65 | __entry->error_type = err_type; |
| 66 | __assign_str(msg, error_msg); |
| 67 | __assign_str(label, label); |
| 68 | __entry->error_count = error_count; |
| 69 | __entry->mc_index = mc_index; |
| 70 | __entry->top_layer = top_layer; |
| 71 | __entry->middle_layer = mid_layer; |
| 72 | __entry->lower_layer = low_layer; |
| 73 | __entry->address = address; |
| 74 | __entry->grain_bits = grain_bits; |
| 75 | __entry->syndrome = syndrome; |
| 76 | __assign_str(driver_detail, driver_detail); |
| 77 | ), |
| 78 | |
| 79 | TP_printk("%d %s error%s:%s%s on %s (mc:%d location:%d:%d:%d address:0x%08lx grain:%d syndrome:0x%08lx%s%s)", |
| 80 | __entry->error_count, |
| 81 | (__entry->error_type == HW_EVENT_ERR_CORRECTED) ? "Corrected" : |
| 82 | ((__entry->error_type == HW_EVENT_ERR_FATAL) ? |
| 83 | "Fatal" : "Uncorrected"), |
| 84 | __entry->error_count > 1 ? "s" : "", |
| 85 | ((char *)__get_str(msg))[0] ? " " : "", |
| 86 | __get_str(msg), |
| 87 | __get_str(label), |
| 88 | __entry->mc_index, |
| 89 | __entry->top_layer, |
| 90 | __entry->middle_layer, |
| 91 | __entry->lower_layer, |
| 92 | __entry->address, |
| 93 | 1 << __entry->grain_bits, |
| 94 | __entry->syndrome, |
| 95 | ((char *)__get_str(driver_detail))[0] ? " " : "", |
| 96 | __get_str(driver_detail)) |
| 97 | ); |
| 98 | |
| 99 | #endif /* _TRACE_HW_EVENT_MC_H */ |
| 100 | |
| 101 | /* This part must be outside protection */ |
| 102 | #include <trace/define_trace.h> |