Blame SOURCES/0027-MCE-make-oops-and-vmcore-MCEs-a-bit-more-similar.patch

a60cd7
From c86f483f58cc8e65030169965c2b4fe34911ef1d Mon Sep 17 00:00:00 2001
a60cd7
From: Denys Vlasenko <dvlasenk@redhat.com>
a60cd7
Date: Thu, 16 Jan 2014 13:11:20 +0100
a60cd7
Subject: [ABRT PATCH 27/27] MCE: make oops and vmcore MCEs a bit more similar
a60cd7
a60cd7
For oops-MCEs, change abrt-action-check-oops-for-hw-error
a60cd7
to write MCE description to "backtrace" instead of "comment"
a60cd7
element.
a60cd7
a60cd7
Extend abrt-action-check-oops-for-hw-error to be able to
a60cd7
detect vmcore MCEs: it will create "not-reportable" element
a60cd7
for them too, as it was doing it for oops-MCEs.
a60cd7
a60cd7
Add post-create processing to vmcore_event.conf which
a60cd7
runs abrt-action-check-oops-for-hw-error on vmcores.
a60cd7
Since that needs dmesg, dmesg extraction also moved
a60cd7
to this event from analyze_VMcore.
a60cd7
a60cd7
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
a60cd7
a60cd7
Related to rhbz#1032077
a60cd7
a60cd7
Signed-off-by: Jakub Filak <jfilak@redhat.com>
a60cd7
---
a60cd7
 src/plugins/abrt-action-check-oops-for-hw-error.in | 14 ++++++++++----
a60cd7
 src/plugins/vmcore_event.conf                      | 13 +++++++++----
a60cd7
 2 files changed, 19 insertions(+), 8 deletions(-)
a60cd7
a60cd7
diff --git a/src/plugins/abrt-action-check-oops-for-hw-error.in b/src/plugins/abrt-action-check-oops-for-hw-error.in
a60cd7
index ce13caf..2333fa1 100644
a60cd7
--- a/src/plugins/abrt-action-check-oops-for-hw-error.in
a60cd7
+++ b/src/plugins/abrt-action-check-oops-for-hw-error.in
a60cd7
@@ -70,7 +70,9 @@ if __name__ == "__main__":
a60cd7
     #
a60cd7
 
a60cd7
     # See if MCEs were seen
a60cd7
-    if not file_has_string("dmesg", "Machine check events logged"):
a60cd7
+    oops_mce = file_has_string("dmesg", "Machine check events logged");
a60cd7
+    vmcore_mce = file_has_string("backtrace", "Machine Check Exception:");
a60cd7
+    if not oops_mce and not vmcore_mce:
a60cd7
         sys.exit(0)
a60cd7
     #
a60cd7
     # There was an MCE. IOW: it's not a bug, it's a HW error.
a60cd7
@@ -81,11 +83,15 @@ if __name__ == "__main__":
a60cd7
     ))
a60cd7
     f.close()
a60cd7
 
a60cd7
+    # vmcore MCEs already have good backtrace element, nothing more to do
a60cd7
+    if vmcore_mce:
a60cd7
+        sys.exit(0)
a60cd7
+
a60cd7
     #
a60cd7
     # Did mcelog logged it to /var/log/mcelog
a60cd7
     # (RHEL6 by default does this)?
a60cd7
     if os.path.exists("/var/log/mcelog"):
a60cd7
-        f = open_or_die("comment", "w")
a60cd7
+        f = open_or_die("backtrace", "w")
a60cd7
         f.write("The kernel log indicates that hardware errors were detected.\n")
a60cd7
         f.write("/var/log/mcelog file may have more information.\n")
a60cd7
         f.write("The last 20 lines of /var/log/mcelog are:\n")
a60cd7
@@ -100,7 +106,7 @@ if __name__ == "__main__":
a60cd7
     # On RHEL7, mcelog is run so that its output ends up in syslog.
a60cd7
     # Do we see that?
a60cd7
     if file_has_string("/var/log/messages", "mcelog: Hardware event"):
a60cd7
-        f = open_or_die("comment", "w")
a60cd7
+        f = open_or_die("backtrace", "w")
a60cd7
         f.write("The kernel log indicates that hardware errors were detected.\n")
a60cd7
         f.write("System log may have more information.\n")
a60cd7
         f.write("The last 20 mcelog lines of system log are:\n")
a60cd7
@@ -114,7 +120,7 @@ if __name__ == "__main__":
a60cd7
     #
a60cd7
     # Apparently, there is no running mcelog daemon!
a60cd7
     # Let user know that he needs one.
a60cd7
-    f = open_or_die("comment", "w")
a60cd7
+    f = open_or_die("backtrace", "w")
a60cd7
     f.write("The kernel log indicates that hardware errors were detected.\n")
a60cd7
     f.write("The data was saved by kernel for processing by the mcelog tool.\n")
a60cd7
     f.write("However, neither /var/log/mcelog nor system log contain mcelog messages.\n")
a60cd7
diff --git a/src/plugins/vmcore_event.conf b/src/plugins/vmcore_event.conf
a60cd7
index a525ec7..34608d9 100644
a60cd7
--- a/src/plugins/vmcore_event.conf
a60cd7
+++ b/src/plugins/vmcore_event.conf
a60cd7
@@ -1,7 +1,6 @@
a60cd7
-# analyze
a60cd7
-EVENT=analyze_VMcore analyzer=vmcore
a60cd7
-        # If kdump machinery already extracted dmesg...
a60cd7
+EVENT=post-create analyzer=vmcore
a60cd7
         (
a60cd7
+        # If kdump machinery already extracted dmesg...
a60cd7
         if test -f vmcore-dmesg.txt; then
a60cd7
             # ...use that
a60cd7
             abrt-dump-oops -o vmcore-dmesg.txt >backtrace || exit $?
a60cd7
@@ -26,7 +25,13 @@ EVENT=analyze_VMcore analyzer=vmcore
a60cd7
             k=`sed -n '/Linux version/ s/.*Linux version \([^ ]*\) .*/\1/p' dmesg_log | tail -n1`
a60cd7
             test "$k" != "" && printf "%s" "$k" >kernel
a60cd7
         fi
a60cd7
-        ) &&
a60cd7
+        )
a60cd7
+        # Do not fail the event (->do not delete problem dir)
a60cd7
+        # if check-oops-for-hw-error exits nonzero:
a60cd7
+        { abrt-action-check-oops-for-hw-error || true; }
a60cd7
+
a60cd7
+# analyze
a60cd7
+EVENT=analyze_VMcore analyzer=vmcore
a60cd7
         abrt-action-analyze-oops &&
a60cd7
         abrt-action-save-kernel-data
a60cd7
 
a60cd7
-- 
a60cd7
1.8.3.1
a60cd7