satyr  0.26
koops/frame.h
Go to the documentation of this file.
1 /*
2  koops_frame.h
3 
4  Copyright (C) 2012 ABRT Team
5  Copyright (C) 2012 Red Hat, Inc.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21 #ifndef SATYR_KOOPS_FRAME_H
22 #define SATYR_KOOPS_FRAME_H
23 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include "../report_type.h"
34 #include <stdbool.h>
35 #include <stdint.h>
36 
37 struct sr_strbuf;
38 struct sr_json_value;
39 
44 {
45  enum sr_report_type type;
46 
52  uint64_t address;
53 
58  bool reliable;
59 
64 
65  uint64_t function_offset;
66 
67  uint64_t function_length;
68 
72  char *module_name;
73 
77  uint64_t from_address;
78 
83 
84  uint64_t from_function_offset;
85 
86  uint64_t from_function_length;
87 
92 
100  /* XXX: we should probably have each stack as a separate thread ... in
101  * uReport3 ? */
103 
104  struct sr_koops_frame *next;
105 };
106 
113 struct sr_koops_frame *
114 sr_koops_frame_new(void);
115 
122 void
123 sr_koops_frame_init(struct sr_koops_frame *frame);
124 
131 void
132 sr_koops_frame_free(struct sr_koops_frame *frame);
133 
147 struct sr_koops_frame *
148 sr_koops_frame_dup(struct sr_koops_frame *frame,
149  bool siblings);
150 
164 int
165 sr_koops_frame_cmp(struct sr_koops_frame *frame1,
166  struct sr_koops_frame *frame2);
167 
181 int
183  struct sr_koops_frame *frame2);
184 
191 struct sr_koops_frame *
193  struct sr_koops_frame *item);
194 
195 struct sr_koops_frame *
196 sr_koops_frame_prepend(struct sr_koops_frame *dest,
197  struct sr_koops_frame *item);
198 
199 struct sr_koops_frame *
200 sr_koops_frame_parse(const char **input);
201 
208 bool
209 sr_koops_skip_timestamp(const char **input);
210 
211 bool
212 sr_koops_parse_address(const char **input, uint64_t *address);
213 
214 bool
215 sr_koops_parse_module_name(const char **input,
216  char **module_name);
217 
218 bool
219 sr_koops_parse_function(const char **input,
220  char **function_name,
221  uint64_t *function_offset,
222  uint64_t *function_length,
223  char **module_name);
224 
231 char *
233 
243 struct sr_koops_frame *
244 sr_koops_frame_from_json(struct sr_json_value *root, char **error_message);
245 
249 void
251  struct sr_strbuf *dest);
252 
253 #ifdef __cplusplus
254 }
255 #endif
256 
257 #endif
char * function_name
Definition: koops/frame.h:63
int sr_koops_frame_cmp_distance(struct sr_koops_frame *frame1, struct sr_koops_frame *frame2)
uint64_t address
Definition: koops/frame.h:52
struct sr_koops_frame * sr_koops_frame_append(struct sr_koops_frame *dest, struct sr_koops_frame *item)
char * from_module_name
Definition: koops/frame.h:91
void sr_koops_frame_init(struct sr_koops_frame *frame)
A resizable string buffer.
Definition: strbuf.h:38
char * module_name
Definition: koops/frame.h:72
char * sr_koops_frame_to_json(struct sr_koops_frame *frame)
struct sr_koops_frame * sr_koops_frame_from_json(struct sr_json_value *root, char **error_message)
struct sr_koops_frame * sr_koops_frame_new(void)
struct sr_koops_frame * sr_koops_frame_dup(struct sr_koops_frame *frame, bool siblings)
Kernel oops stack frame.
Definition: koops/frame.h:43
void sr_koops_frame_append_to_str(struct sr_koops_frame *frame, struct sr_strbuf *dest)
int sr_koops_frame_cmp(struct sr_koops_frame *frame1, struct sr_koops_frame *frame2)
char * special_stack
Definition: koops/frame.h:102
void sr_koops_frame_free(struct sr_koops_frame *frame)
char * from_function_name
Definition: koops/frame.h:82
uint64_t from_address
Definition: koops/frame.h:77