krishnanadh / rpms / rasdaemon

Forked from rpms/rasdaemon a year ago
Clone

Blame SOURCES/0055-rasdaemon-use-MCA-error-msg-as-error_msg.patch

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