>From e5e0209868763073b4a82c6874a7e9d21fd7c8e5 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Sat, 27 Mar 2010 17:25:02 +0100 Subject: [PATCH 2/4] mce, trace: Add decoded string to mce_record's format Put the decoded error string into the trace record. Not-Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce.c | 2 +- include/trace/events/mce.h | 43 +++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index b57c185..3880f3c 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -161,7 +161,7 @@ void mce_log(struct mce *mce) unsigned next, entry; /* Emit the trace record: */ - trace_mce_record(mce); + trace_mce_record(mce, ""); mce->finished = 0; wmb(); diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h index 7eee778..96b040a 100644 --- a/include/trace/events/mce.h +++ b/include/trace/events/mce.h @@ -8,11 +8,13 @@ #include #include +#define DECODED_ERR_SZ 200 + TRACE_EVENT(mce_record, - TP_PROTO(struct mce *m), + TP_PROTO(struct mce *m, char *decoded_err), - TP_ARGS(m), + TP_ARGS(m, decoded_err), TP_STRUCT__entry( __field( u64, mcgcap ) @@ -30,27 +32,29 @@ TRACE_EVENT(mce_record, __field( u32, apicid ) __field( u32, socketid ) __field( u8, cpuvendor ) + __array( char, decoded_err, DECODED_ERR_SZ) ), TP_fast_assign( - __entry->mcgcap = m->mcgcap; - __entry->mcgstatus = m->mcgstatus; - __entry->bank = m->bank; - __entry->status = m->status; - __entry->addr = m->addr; - __entry->misc = m->misc; - __entry->ip = m->ip; - __entry->cs = m->cs; - __entry->tsc = m->tsc; - __entry->walltime = m->time; - __entry->cpu = m->extcpu; - __entry->cpuid = m->cpuid; - __entry->apicid = m->apicid; - __entry->socketid = m->socketid; - __entry->cpuvendor = m->cpuvendor; + __entry->mcgcap = m->mcgcap; + __entry->mcgstatus = m->mcgstatus; + __entry->bank = m->bank; + __entry->status = m->status; + __entry->addr = m->addr; + __entry->misc = m->misc; + __entry->ip = m->ip; + __entry->cs = m->cs; + __entry->tsc = m->tsc; + __entry->walltime = m->time; + __entry->cpu = m->extcpu; + __entry->cpuid = m->cpuid; + __entry->apicid = m->apicid; + __entry->socketid = m->socketid; + __entry->cpuvendor = m->cpuvendor; + memcpy(__entry->decoded_err, decoded_err, DECODED_ERR_SZ); ), - TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, ADDR/MISC: %016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x", + TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, ADDR/MISC: %016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x\nErr: %s\n", __entry->cpu, __entry->mcgcap, __entry->mcgstatus, __entry->bank, __entry->status, @@ -60,7 +64,8 @@ TRACE_EVENT(mce_record, __entry->cpuvendor, __entry->cpuid, __entry->walltime, __entry->socketid, - __entry->apicid) + __entry->apicid, + __entry->decoded_err) ); #endif /* _TRACE_MCE_H */ -- 1.6.4.4