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

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