lkml.org 
[lkml]   [2012]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 32/31] edac: restore mce.h file
Date
Trace doesn't like to have the same trace file included into
two different places. I only noticed it when compiling the
entire tree again on a different machine.

Partially reverts commit 4eb2a29419c1fefd76c8dbcd308b84a4b52faf4d

I'll likely work on another approach, as keeping the mce_record
on a different place than the other *mce traces don't seem right,
but, for now, let's just take the shortest way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
include/trace/events/hw_event.h | 62 +++------------------------------
include/trace/events/mce.h | 69 ++++++++++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 57 deletions(-)
create mode 100644 include/trace/events/mce.h

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index c219f72..2af127d 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -53,7 +53,7 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex);
lockdep_is_held(&mce_chrdev_read_mutex))

#define CREATE_TRACE_POINTS
-#include <trace/events/hw_event.h>
+#include <trace/events/mce.h>

int mce_disabled __read_mostly;

diff --git a/include/trace/events/hw_event.h b/include/trace/events/hw_event.h
index ade0185..91522b3 100644
--- a/include/trace/events/hw_event.h
+++ b/include/trace/events/hw_event.h
@@ -142,66 +142,16 @@ TRACE_EVENT(mc_out_of_range,
#include <asm/mce.h>

/*
- * Generic MCE event
+ * MCE event for memory-controller errors
*/
-TRACE_EVENT(mce_record,
-
- TP_PROTO(const struct mce *m),
-
- TP_ARGS(m),
-
- TP_STRUCT__entry(
- __field( u64, mcgcap )
- __field( u64, mcgstatus )
- __field( u64, status )
- __field( u64, addr )
- __field( u64, misc )
- __field( u64, ip )
- __field( u64, tsc )
- __field( u64, walltime )
- __field( u32, cpu )
- __field( u32, cpuid )
- __field( u32, apicid )
- __field( u32, socketid )
- __field( u8, cs )
- __field( u8, bank )
- __field( u8, cpuvendor )
- ),
-
- TP_fast_assign(
- __entry->mcgcap = m->mcgcap;
- __entry->mcgstatus = m->mcgstatus;
- __entry->status = m->status;
- __entry->addr = m->addr;
- __entry->misc = m->misc;
- __entry->ip = m->ip;
- __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->cs = m->cs;
- __entry->bank = m->bank;
- __entry->cpuvendor = m->cpuvendor;
- ),
-
- 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",
- __entry->cpu,
- __entry->mcgcap, __entry->mcgstatus,
- __entry->bank, __entry->status,
- __entry->addr, __entry->misc,
- __entry->cs, __entry->ip,
- __entry->tsc,
- __entry->cpuvendor, __entry->cpuid,
- __entry->walltime,
- __entry->socketid,
- __entry->apicid)
-);

/*
- * MCE event for memory-controller errors
+ * NOTE: due to trace contraints, we can't have the mce_record at the
+ * same file as mce_record, as they're used by different files. Including
+ * trace headers twice cause duplicated symbols. So, care is needed to
+ * sync changes here with changes at include/trace/events/mce.h.
*/
+
TRACE_EVENT(mc_error_mce,

TP_PROTO(const unsigned int err_type,
diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h
new file mode 100644
index 0000000..4cbbcef
--- /dev/null
+++ b/include/trace/events/mce.h
@@ -0,0 +1,69 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM mce
+
+#if !defined(_TRACE_MCE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_MCE_H
+
+#include <linux/ktime.h>
+#include <linux/tracepoint.h>
+#include <asm/mce.h>
+
+TRACE_EVENT(mce_record,
+
+ TP_PROTO(struct mce *m),
+
+ TP_ARGS(m),
+
+ TP_STRUCT__entry(
+ __field( u64, mcgcap )
+ __field( u64, mcgstatus )
+ __field( u64, status )
+ __field( u64, addr )
+ __field( u64, misc )
+ __field( u64, ip )
+ __field( u64, tsc )
+ __field( u64, walltime )
+ __field( u32, cpu )
+ __field( u32, cpuid )
+ __field( u32, apicid )
+ __field( u32, socketid )
+ __field( u8, cs )
+ __field( u8, bank )
+ __field( u8, cpuvendor )
+ ),
+
+ TP_fast_assign(
+ __entry->mcgcap = m->mcgcap;
+ __entry->mcgstatus = m->mcgstatus;
+ __entry->status = m->status;
+ __entry->addr = m->addr;
+ __entry->misc = m->misc;
+ __entry->ip = m->ip;
+ __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->cs = m->cs;
+ __entry->bank = m->bank;
+ __entry->cpuvendor = m->cpuvendor;
+ ),
+
+ 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",
+ __entry->cpu,
+ __entry->mcgcap, __entry->mcgstatus,
+ __entry->bank, __entry->status,
+ __entry->addr, __entry->misc,
+ __entry->cs, __entry->ip,
+ __entry->tsc,
+ __entry->cpuvendor, __entry->cpuid,
+ __entry->walltime,
+ __entry->socketid,
+ __entry->apicid)
+);
+
+#endif /* _TRACE_MCE_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
--
1.7.8


\
 
 \ /
  Last update: 2012-02-10 17:51    [W:0.134 / U:1.360 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site