23 #ifndef SATYR_COMPAT_H_
24 #define SATYR_COMPAT_H_
31 #include <satyr/core_frame.h>
32 #include <satyr/core_stacktrace.h>
33 #include <satyr/core_thread.h>
34 #include <satyr/distance.h>
35 #include <satyr/gdb_frame.h>
36 #include <satyr/gdb_stacktrace.h>
37 #include <satyr/location.h>
38 #include <satyr/metrics.h>
39 #include <satyr/normalize.h>
40 #include <satyr/sha1.h>
41 #include <satyr/utils.h>
43 #define BACKTRACE_DUP_THRESHOLD 0.3
48 #include <btparser/frame.h>
49 #include <btparser/thread.h>
50 #include <btparser/normalize.h>
51 #include <btparser/metrics.h>
52 #include <btparser/core-backtrace.h>
53 #include <btparser/backtrace.h>
54 #include <btparser/frame.h>
55 #include <btparser/location.h>
58 #define BACKTRACE_DUP_THRESHOLD 2.0
61 #define sr_core_stacktrace btp_thread
62 #define sr_core_thread btp_thread
66 SR_DISTANCE_DAMERAU_LEVENSHTEIN
73 struct sr_core_stacktrace *
74 sr_core_stacktrace_from_json_text(
const char *text,
77 struct btp_thread *thread = btp_load_core_backtrace(text);
80 *error_message = xstrdup(
81 "Failed to parse backtrace, considering it not duplicate");
84 return btp_load_core_backtrace(text);
87 struct sr_core_thread *
88 sr_core_stacktrace_find_crash_thread(
struct sr_core_stacktrace *stacktrace)
94 sr_core_thread_get_frame_count(
struct sr_core_thread *thread)
96 return btp_thread_get_frame_count(thread);
100 sr_core_thread_cmp(
struct sr_core_thread *thread1,
101 struct sr_core_thread *thread2)
103 return btp_thread_cmp(thread1, thread2);
107 sr_distance_core(
enum sr_distance_type distance_type,
108 struct sr_core_thread *thread1,
109 struct sr_core_thread *thread2)
111 return btp_thread_levenshtein_distance_custom(thread1, thread2,
true,
112 btp_core_backtrace_frame_cmp);
116 sr_core_stacktrace_free(
struct sr_core_stacktrace *stacktrace)
118 btp_free_core_backtrace(stacktrace);
122 #define sr_location btp_location
123 #define sr_gdb_stacktrace btp_backtrace
124 #define sr_gdb_frame btp_frame
127 sr_location_init(
struct sr_location *location)
129 btp_location_init(location);
132 struct sr_gdb_stacktrace *
133 sr_gdb_stacktrace_parse(
const char **input,
134 struct sr_location *location)
136 return btp_backtrace_parse(input, location);
140 sr_gdb_stacktrace_get_duplication_hash(
struct sr_gdb_stacktrace *stacktrace)
142 return btp_backtrace_get_duplication_hash(stacktrace);
146 sr_gdb_stacktrace_quality_complex(
struct sr_gdb_stacktrace *stacktrace)
148 return btp_backtrace_quality_complex(stacktrace);
151 struct sr_gdb_frame *
152 sr_gdb_stacktrace_get_crash_frame(
struct sr_gdb_stacktrace *stacktrace)
154 return btp_backtrace_get_crash_frame(stacktrace);
158 sr_gdb_frame_free(
struct sr_gdb_frame *frame)
160 btp_frame_free(frame);
164 sr_gdb_stacktrace_free(
struct sr_gdb_stacktrace *stacktrace)
166 btp_backtrace_free(stacktrace);