2 #define TRACE_SYSTEM ras
3 #define TRACE_INCLUDE_FILE ras_event
5 #if !defined(_TRACE_HW_EVENT_MC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_HW_EVENT_MC_H
8 #include <linux/tracepoint.h>
9 #include <linux/edac.h>
10 #include <linux/ktime.h>
13 * Hardware Events Report
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.
19 * FIXME: Add events for handling memory errors originated from the
24 * Hardware-independent Memory Controller specific events
28 * Default error mechanisms for Memory Controller errors (CE and UE)
32 TP_PROTO(const unsigned int err_type
,
33 const char *error_msg
,
35 const int error_count
,
40 unsigned long address
,
42 unsigned long syndrome
,
43 const char *driver_detail
),
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
),
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
)
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
);
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)",
81 mc_event_error_type(__entry
->error_type
),
82 __entry
->error_count
> 1 ? "s" : "",
83 ((char *)__get_str(msg
))[0] ? " " : "",
88 __entry
->middle_layer
,
91 1 << __entry
->grain_bits
,
93 ((char *)__get_str(driver_detail
))[0] ? " " : "",
94 __get_str(driver_detail
))
97 #endif /* _TRACE_HW_EVENT_MC_H */
99 /* This part must be outside protection */
100 #include <trace/define_trace.h>