public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: linux-edac <linux-edac@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Tony Luck <tony.luck@intel.com>,
	Yazen Ghannam <Yazen.Ghannam@amd.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/7] x86/mce: Extend the MCE tracepoint with a decoded string
Date: Fri, 25 Aug 2017 12:24:06 +0200	[thread overview]
Message-ID: <20170825102411.8682-3-bp@alien8.de> (raw)
In-Reply-To: <20170825102411.8682-1-bp@alien8.de>

From: Borislav Petkov <bp@suse.de>

... which will be filled in by an in-kernel decoder, if one present.
Export it to modules too.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
 arch/x86/kernel/cpu/mcheck/mce.c |  3 ++-
 include/trace/events/mce.h       | 11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index dcf75f40e031..62bab5d5e96c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -59,6 +59,7 @@ static DEFINE_MUTEX(mce_log_mutex);
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/mce.h>
+EXPORT_TRACEPOINT_SYMBOL_GPL(mce_record);
 
 #define SPINUNIT		100	/* 100ns */
 
@@ -564,7 +565,7 @@ static int mce_first_notifier(struct notifier_block *nb, unsigned long val,
 
 	/* Emit the trace record: */
 	if (!mca_cfg.has_decoder)
-		trace_mce_record(m);
+		trace_mce_record(m, "");
 
 	set_bit(0, &mce_need_notify);
 
diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h
index 70f02149808c..82ff4014fab1 100644
--- a/include/trace/events/mce.h
+++ b/include/trace/events/mce.h
@@ -10,9 +10,9 @@
 
 TRACE_EVENT(mce_record,
 
-	TP_PROTO(struct mce *m),
+	TP_PROTO(struct mce *m, const char *param_str),
 
-	TP_ARGS(m),
+	TP_ARGS(m, param_str),
 
 	TP_STRUCT__entry(
 		__field(	u64,		mcgcap		)
@@ -32,6 +32,7 @@ TRACE_EVENT(mce_record,
 		__field(	u8,		cs		)
 		__field(	u8,		bank		)
 		__field(	u8,		cpuvendor	)
+		__string(	str,		param_str	)
 	),
 
 	TP_fast_assign(
@@ -52,9 +53,10 @@ TRACE_EVENT(mce_record,
 		__entry->cs		= m->cs;
 		__entry->bank		= m->bank;
 		__entry->cpuvendor	= m->cpuvendor;
+		__assign_str(str, param_str);
 	),
 
-	TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR/MISC/SYND: %016Lx/%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, IPID: %016Lx, ADDR/MISC/SYND: %016Lx/%016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x %s",
 		__entry->cpu,
 		__entry->mcgcap, __entry->mcgstatus,
 		__entry->bank, __entry->status,
@@ -65,7 +67,8 @@ TRACE_EVENT(mce_record,
 		__entry->cpuvendor, __entry->cpuid,
 		__entry->walltime,
 		__entry->socketid,
-		__entry->apicid)
+		__entry->apicid,
+		__get_str(str))
 );
 
 #endif /* _TRACE_MCE_H */
-- 
2.13.0

  parent reply	other threads:[~2017-08-25 10:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 10:24 [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint Borislav Petkov
2017-08-25 10:24 ` [PATCH 1/7] x86/mce: Handle an in-kernel MCE decoder Borislav Petkov
2017-08-25 10:24 ` Borislav Petkov [this message]
2017-08-25 10:24 ` [PATCH 3/7] seq_buf: Add seq_buf_clear_buf() Borislav Petkov
2017-08-25 10:24 ` [PATCH 4/7] seq_buf: Export seq_buf_printf() to modules Borislav Petkov
2017-08-25 13:27   ` Steven Rostedt
2017-08-25 10:24 ` [PATCH 5/7] EDAC, mce_amd: Convert to seq_buf Borislav Petkov
2017-08-25 13:30   ` Steven Rostedt
2017-08-25 10:24 ` [PATCH 6/7] EDAC, mce_amd: Issue the decoded info through the TP or printk() Borislav Petkov
2017-08-25 13:33   ` Steven Rostedt
2017-08-25 10:24 ` [PATCH 7/7] x86/mce: Issue the mcelog --ascii message on !AMD Borislav Petkov
2017-08-28 13:45 ` [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint Borislav Petkov
2017-08-30 11:48   ` Borislav Petkov
2017-08-30 21:47     ` mark gross
2017-08-30 22:02       ` Borislav Petkov
2017-08-31 19:17         ` Borislav Petkov
2017-08-30 23:30       ` Steven Rostedt
2017-09-03 23:37         ` mark gross
2017-09-04 10:47           ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170825102411.8682-3-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox