Skip to content

Commit 186d7ef

Browse files
Avadhut NaikIngo Molnar
authored andcommitted
tracing: Add the ::microcode field to the mce_record tracepoint
Currently, the microcode field (Microcode Revision) of 'struct mce' is not exposed to userspace through the mce_record tracepoint. Knowing the microcode version on which the MCE was received is critical information for debugging. If the version is not recorded, later attempts to acquire the version might result in discrepancies since it can be changed at runtime. Add microcode version to the tracepoint to prevent ambiguity over the active version on the system when the MCE was received. Signed-off-by: Avadhut Naik <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Steven Rostedt (Google) <[email protected]> Reviewed-by: Tony Luck <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9843064 commit 186d7ef

File tree

1 file changed

+5
-2
lines changed
  • include/trace/events

1 file changed

+5
-2
lines changed

include/trace/events/mce.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ TRACE_EVENT(mce_record,
4242
__field( u8, cs )
4343
__field( u8, bank )
4444
__field( u8, cpuvendor )
45+
__field( u32, microcode )
4546
),
4647

4748
TP_fast_assign(
@@ -63,9 +64,10 @@ TRACE_EVENT(mce_record,
6364
__entry->cs = m->cs;
6465
__entry->bank = m->bank;
6566
__entry->cpuvendor = m->cpuvendor;
67+
__entry->microcode = m->microcode;
6668
),
6769

68-
TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x",
70+
TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x, microcode: %x",
6971
__entry->cpu,
7072
__entry->mcgcap, __entry->mcgstatus,
7173
__entry->bank, __entry->status,
@@ -80,7 +82,8 @@ TRACE_EVENT(mce_record,
8082
__entry->cpuid,
8183
__entry->walltime,
8284
__entry->socketid,
83-
__entry->apicid)
85+
__entry->apicid,
86+
__entry->microcode)
8487
);
8588

8689
#endif /* _TRACE_MCE_H */

0 commit comments

Comments
 (0)