satyr  0.42
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 <json.h>
35 #include <stdbool.h>
36 #include <glib.h>
37 
38 struct sr_location;
39 
44 {
45  enum sr_report_type type;
46 
59  uint64_t address;
60 
64  char *build_id;
65  // in ELF section
66  uint64_t build_id_offset;
67  // function name
68  char *function_name;
69  // so or executable
70  char *file_name;
72  char *fingerprint;
73 
76 
82 };
83 
90 struct sr_core_frame *
91 sr_core_frame_new(void);
92 
99 void
100 sr_core_frame_init(struct sr_core_frame *frame);
101 
108 void
109 sr_core_frame_free(struct sr_core_frame *frame);
110 
125 struct sr_core_frame *
126 sr_core_frame_dup(struct sr_core_frame *frame,
127  bool siblings);
128 
143 bool
145  const char *function_name,
146  ...);
147 
161 int
162 sr_core_frame_cmp(struct sr_core_frame *frame1,
163  struct sr_core_frame *frame2);
164 
178 int
180  struct sr_core_frame *frame2);
181 
188 struct sr_core_frame *
190  struct sr_core_frame *item);
191 
198 char *
199 sr_core_frame_to_json(struct sr_core_frame *frame);
200 
210 struct sr_core_frame *
211 sr_core_frame_from_json(json_object *root,
212  char **error_message);
213 
217 void
219  GString *dest);
220 
221 #ifdef __cplusplus
222 }
223 #endif
224 
225 #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:64
uint64_t address
Definition: core/frame.h:59
bool fingerprint_hashed
Definition: core/frame.h:75
struct sr_core_frame * sr_core_frame_from_json(json_object *root, char **error_message)
struct sr_core_frame * sr_core_frame_new(void)
char * fingerprint
Definition: core/frame.h:72
int sr_core_frame_cmp_distance(struct sr_core_frame *frame1, struct sr_core_frame *frame2)
int sr_core_frame_cmp(struct sr_core_frame *frame1, struct sr_core_frame *frame2)
void sr_core_frame_append_to_str(struct sr_core_frame *frame, GString *dest)
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 * next
Definition: core/frame.h:81