mfabik / rpms / satyr

Forked from rpms/satyr 3 years ago
Clone

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

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