Skip to content

Commit 83355d3

Browse files
committed
tracing: Add the ::microcode field to the mce_record tracepoint
JIRA: https://issues.redhat.com/browse/RHEL-55136 commit 186d7ef Author: Avadhut Naik <avadhut.naik@amd.com> Date: Mon Apr 1 12:14:55 2024 -0500 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 <avadhut.naik@amd.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Sohil Mehta <sohil.mehta@intel.com> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Reviewed-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20240401171455.1737976-3-avadhut.naik@amd.com Signed-off-by: David Arcari <darcari@redhat.com>
1 parent b3da1ce commit 83355d3

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)