satyr  0.24.15.g3735.dirty
core/frame.h
Go to the documentation of this file.
1 /*
2  core_frame.h
3 
4  Copyright (C) 2011, 2012 Red Hat, Inc.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20 #ifndef SATYR_CORE_FRAME_H
21 #define SATYR_CORE_FRAME_H
22 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "../report_type.h"
33 #include <inttypes.h>
34 #include <stdbool.h>
35 
36 struct sr_strbuf;
37 struct sr_location;
38 struct sr_json_value;
39 
44 {
45  enum sr_report_type type;
46 
56  uint64_t address;
57 
61  char *build_id;
62  // in ELF section
63  uint64_t build_id_offset;
64  // function name
65  char *function_name;
66  // so or executable
67  char *file_name;
69  char *fingerprint;
70 
73 
79 };
80 
87 struct sr_core_frame *
88 sr_core_frame_new(void);
89 
96 void
97 sr_core_frame_init(struct sr_core_frame *frame);
98 
105 void
106 sr_core_frame_free(struct sr_core_frame *frame);
107 
122 struct sr_core_frame *
123 sr_core_frame_dup(struct sr_core_frame *frame,
124  bool siblings);
125 
140 bool
142  const char *function_name,
143  ...);
144 
158 int
159 sr_core_frame_cmp(struct sr_core_frame *frame1,
160  struct sr_core_frame *frame2);
161 
175 int
177  struct sr_core_frame *frame2);
178 
185 struct sr_core_frame *
187  struct sr_core_frame *item);
188 
195 char *
196 sr_core_frame_to_json(struct sr_core_frame *frame);
197 
207 struct sr_core_frame *
209  char **error_message);
210 
214 void
216  struct sr_strbuf *dest);
217 
218 #ifdef __cplusplus
219 }
220 #endif
221 
222 #endif
A function call on call stack of a core dump.
Definition: core/frame.h:43
void sr_core_frame_free(struct sr_core_frame *frame)
char * build_id
Definition: core/frame.h:61
uint64_t address
Definition: core/frame.h:56
void sr_core_frame_append_to_str(struct sr_core_frame *frame, struct sr_strbuf *dest)
bool fingerprint_hashed
Definition: core/frame.h:72
struct sr_core_frame * sr_core_frame_new(void)
char * fingerprint
Definition: core/frame.h:69
int sr_core_frame_cmp_distance(struct sr_core_frame *frame1, struct sr_core_frame *frame2)
A resizable string buffer.
Definition: strbuf.h:38
int sr_core_frame_cmp(struct sr_core_frame *frame1, struct sr_core_frame *frame2)
char * sr_core_frame_to_json(struct sr_core_frame *frame)
void sr_core_frame_init(struct sr_core_frame *frame)
struct sr_core_frame * sr_core_frame_dup(struct sr_core_frame *frame, bool siblings)
struct sr_core_frame * sr_core_frame_append(struct sr_core_frame *dest, struct sr_core_frame *item)
bool sr_core_frame_calls_func(struct sr_core_frame *frame, const char *function_name,...)
A location of a parser in the input stream.
Definition: location.h:42
struct sr_core_frame * sr_core_frame_from_json(struct sr_json_value *root, char **error_message)
struct sr_core_frame * next
Definition: core/frame.h:78