krishnanadh / rpms / rasdaemon

Forked from rpms/rasdaemon a year ago
Clone
d9e469
From 9136d7422a6b53c50a920f3dd2539bf7fcd4fdf5 Mon Sep 17 00:00:00 2001
d9e469
From: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
d9e469
Date: Fri, 12 Jun 2015 06:35:37 -0300
d9e469
Subject: [PATCH 4/5] rasdaemon: use MCA error msg as error_msg
d9e469
d9e469
In the case of machine-checks which do not have a model-specific MCA
d9e469
error code but have an architectural code only, mce_event.error_msg
d9e469
becomes empty then you don't know what happened.
d9e469
d9e469
(snip)
d9e469
MCE records summary:
d9e469
	1  errors
d9e469
          ^
d9e469
          empty!
d9e469
d9e469
(snip)
d9e469
MCE events:
d9e469
1 2015-06-12 00:21:46 +0900 error: , mcg mcgstatus= 0, mci Corrected_error
d9e469
                                  ^
d9e469
                                empty!
d9e469
d9e469
Error_enabled, mcgcap=0x07000c16, status=0x9c0000000000017a, addr=0x204fffffff, misc=0x4004000000000080, walltime=0x557b0db2, cpu=0x00000001, cpuid=0x000306f3, apicid=0x00000002, bank=0x00000003
d9e469
d9e469
In such a case, let's use the content of mcastatus_msg as error_msg
d9e469
instead.
d9e469
d9e469
(snip)
d9e469
MCE records summary:
d9e469
	1 Generic CACHE Level-2 Eviction Error errors
d9e469
(snip)
d9e469
MCE events:
d9e469
1 2015-06-12 02:39:04 +0900 error: Generic CACHE Level-2 Eviction Error, mcg mcgstatus= 0, mci Corrected_error Error_enabled, mcgcap=0x07000c16, status=0x9c0000000000017a, addr=0x204fffffff, misc=0x4004000000000080, walltime=0x557b1f22, cpu=0x00000001, cpuid=0x000306f3, apicid=0x00000002, bank=0x00000003
d9e469
d9e469
Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
d9e469
Acked-by: Aristeu Rozanski <aris@redhat.com>
d9e469
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
d9e469
---
d9e469
 ras-mce-handler.c | 3 +++
d9e469
 1 file changed, 3 insertions(+)
d9e469
d9e469
diff --git a/ras-mce-handler.c b/ras-mce-handler.c
d9e469
index 07252a0..3976f90 100644
d9e469
--- a/ras-mce-handler.c
d9e469
+++ b/ras-mce-handler.c
d9e469
@@ -411,6 +411,9 @@ int ras_mce_event_handler(struct trace_seq *s,
d9e469
 	if (rc)
d9e469
 		return rc;
d9e469
 
d9e469
+	if (!*e.error_msg && *e.mcastatus_msg)
d9e469
+		mce_snprintf(e.error_msg, "%s", e.mcastatus_msg);
d9e469
+
d9e469
 	report_mce_event(ras, record, s, &e);
d9e469
 
d9e469
 #ifdef HAVE_SQLITE3
d9e469
-- 
d9e469
1.8.3.1
d9e469