mfabik / rpms / satyr

Forked from rpms/satyr 3 years ago
Clone

Blame SOURCES/satyr-0.13-fulfill-missing-values-in-core-frames.patch

f41043
From 90f464eb0c1ee4f5c23cb34ec6d199ae648625fe Mon Sep 17 00:00:00 2001
f41043
From: Jakub Filak <jfilak@redhat.com>
f41043
Date: Fri, 16 May 2014 13:50:22 +0200
f41043
Subject: [PATCH 1/5] Fulfill missing values in core/frames
f41043
f41043
File name of __kernel_vsyscall function frame cannot be resolved but we
f41043
known that the function comes from kernel.
f41043
f41043
The frame often appears in backtraces of sleep.
f41043
f41043
Signed-off-by: Jakub Filak <jfilak@redhat.com>
f41043
---
f41043
 lib/abrt.c | 24 ++++++++++++++++++++++++
f41043
 1 file changed, 24 insertions(+)
f41043
f41043
diff --git a/lib/abrt.c b/lib/abrt.c
f41043
index 39bc45d..ed33800 100644
f41043
--- a/lib/abrt.c
f41043
+++ b/lib/abrt.c
f41043
@@ -24,6 +24,8 @@
f41043
 #include "operating_system.h"
f41043
 #include "core/unwind.h"
f41043
 #include "core/stacktrace.h"
f41043
+#include "core/thread.h"
f41043
+#include "core/frame.h"
f41043
 #include "core/fingerprint.h"
f41043
 #include "python/stacktrace.h"
f41043
 #include "koops/stacktrace.h"
f41043
@@ -62,6 +64,26 @@ sr_abrt_print_report_from_dir(const char *directory,
f41043
     return true;
f41043
 }
f41043
 
f41043
+static void
f41043
+fulfill_missing_values(struct sr_core_stacktrace *core_stacktrace)
f41043
+{
f41043
+    struct sr_core_thread *thread = core_stacktrace->threads;
f41043
+    while (thread)
f41043
+    {
f41043
+        struct sr_core_frame *frame = thread->frames;
f41043
+        while (frame)
f41043
+        {
f41043
+            if (!frame->file_name && frame->function_name
f41043
+                && strcmp("__kernel_vsyscall", frame->function_name) == 0)
f41043
+            {
f41043
+                frame->file_name = sr_strdup("kernel");
f41043
+            }
f41043
+            frame = frame->next;
f41043
+        }
f41043
+        thread = thread->next;
f41043
+    }
f41043
+}
f41043
+
f41043
 static bool
f41043
 create_core_stacktrace(const char *directory, const char *gdb_output,
f41043
                        bool hash_fingerprints, char **error_message)
f41043
@@ -87,6 +109,8 @@ create_core_stacktrace(const char *directory, const char *gdb_output,
f41043
     if (!core_stacktrace)
f41043
         return false;
f41043
 
f41043
+    fulfill_missing_values(core_stacktrace);
f41043
+
f41043
 #if 0
f41043
     sr_core_fingerprint_generate(core_stacktrace,
f41043
                                  error_message);
f41043
-- 
f41043
2.4.3
f41043