1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM mce
5 #if !defined(_TRACE_MCE_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/ktime.h>
9 #include <linux/tracepoint.h>
15 * Only very relevant and transient information which cannot be
16 * gathered from a system by any other means or which can only be
17 * acquired arduously should be added to this record.
20 TRACE_EVENT(mce_record
,
22 TP_PROTO(struct mce_hw_err
*err
),
27 __field( u64
, mcgcap
)
28 __field( u64
, mcgstatus
)
29 __field( u64
, status
)
37 __field( u64
, walltime
)
40 __field( u32
, apicid
)
41 __field( u32
, socketid
)
44 __field( u8
, cpuvendor
)
45 __field( u32
, microcode
)
46 __dynamic_array(u8
, v_data
, sizeof(err
->vendor
))
50 __entry
->mcgcap
= err
->m
.mcgcap
;
51 __entry
->mcgstatus
= err
->m
.mcgstatus
;
52 __entry
->status
= err
->m
.status
;
53 __entry
->addr
= err
->m
.addr
;
54 __entry
->misc
= err
->m
.misc
;
55 __entry
->synd
= err
->m
.synd
;
56 __entry
->ipid
= err
->m
.ipid
;
57 __entry
->ip
= err
->m
.ip
;
58 __entry
->tsc
= err
->m
.tsc
;
59 __entry
->ppin
= err
->m
.ppin
;
60 __entry
->walltime
= err
->m
.time
;
61 __entry
->cpu
= err
->m
.extcpu
;
62 __entry
->cpuid
= err
->m
.cpuid
;
63 __entry
->apicid
= err
->m
.apicid
;
64 __entry
->socketid
= err
->m
.socketid
;
65 __entry
->cs
= err
->m
.cs
;
66 __entry
->bank
= err
->m
.bank
;
67 __entry
->cpuvendor
= err
->m
.cpuvendor
;
68 __entry
->microcode
= err
->m
.microcode
;
69 memcpy(__get_dynamic_array(v_data
), &err
->vendor
, sizeof(err
->vendor
));
72 TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016llx, IPID: %016llx, ADDR: %016llx, MISC: %016llx, SYND: %016llx, RIP: %02x:<%016llx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x, microcode: %x, vendor data: %s",
74 __entry
->mcgcap
, __entry
->mcgstatus
,
75 __entry
->bank
, __entry
->status
,
80 __entry
->cs
, __entry
->ip
,
89 __print_dynamic_array(v_data
, sizeof(u8
)))
92 #endif /* _TRACE_MCE_H */
94 /* This part must be outside protection */
95 #include <trace/define_trace.h>