satyr 0.42
Loading...
Searching...
No Matches
Data Structures | Functions
koops/frame.h File Reference

Kernel oops stack frame. More...

#include "../report_type.h"
#include <json.h>
#include <stdbool.h>
#include <stdint.h>
#include <glib.h>

Go to the source code of this file.

Data Structures

struct  sr_koops_frame
 Kernel oops stack frame. More...
 

Functions

struct sr_koops_framesr_koops_frame_new (void)
 
void sr_koops_frame_init (struct sr_koops_frame *frame)
 
void sr_koops_frame_free (struct sr_koops_frame *frame)
 
struct sr_koops_framesr_koops_frame_dup (struct sr_koops_frame *frame, bool siblings)
 
int sr_koops_frame_cmp (struct sr_koops_frame *frame1, struct sr_koops_frame *frame2)
 
int sr_koops_frame_cmp_distance (struct sr_koops_frame *frame1, struct sr_koops_frame *frame2)
 
struct sr_koops_framesr_koops_frame_append (struct sr_koops_frame *dest, struct sr_koops_frame *item)
 
struct sr_koops_framesr_koops_frame_prepend (struct sr_koops_frame *dest, struct sr_koops_frame *item)
 
struct sr_koops_framesr_koops_frame_parse (const char **input)
 
bool sr_koops_skip_timestamp (const char **input)
 
bool sr_koops_parse_address (const char **input, uint64_t *address)
 
bool sr_koops_parse_module_name (const char **input, char **module_name)
 
bool sr_koops_parse_function (const char **input, char **function_name, uint64_t *function_offset, uint64_t *function_length, char **module_name)
 
char * sr_koops_frame_to_json (struct sr_koops_frame *frame)
 
struct sr_koops_framesr_koops_frame_from_json (json_object *root, char **error_message)
 
void sr_koops_frame_append_to_str (struct sr_koops_frame *frame, GString *dest)
 

Detailed Description

Kernel oops stack frame.

Definition in file koops/frame.h.

Function Documentation

◆ sr_koops_frame_append()

struct sr_koops_frame * sr_koops_frame_append ( struct sr_koops_frame dest,
struct sr_koops_frame item 
)

Appends 'item' at the end of the list 'dest'.

Returns
This function returns the 'dest' frame. If 'dest' is NULL, it returns the 'item' frame.
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_append_to_str()

void sr_koops_frame_append_to_str ( struct sr_koops_frame frame,
GString *  dest 
)

Appends textual representation of the frame to the string buffer dest.

Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_cmp()

int sr_koops_frame_cmp ( struct sr_koops_frame frame1,
struct sr_koops_frame frame2 
)

Compares two frames.

Parameters
frame1It must be non-NULL pointer. It's not modified by calling this function.
frame2It must be non-NULL pointer. It's not modified by calling this function.
Returns
Returns 0 if the frames are same. Returns negative number if frame1 is found to be 'less' than frame2. Returns positive number if frame1 is found to be 'greater' than frame2.
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_cmp_distance()

int sr_koops_frame_cmp_distance ( struct sr_koops_frame frame1,
struct sr_koops_frame frame2 
)

Compares two frames.

Parameters
frame1It must be non-NULL pointer. It's not modified by calling this function.
frame2It must be non-NULL pointer. It's not modified by calling this function.
Returns
Returns 0 if the frames are same. Returns negative number if frame1 is found to be 'less' than frame2. Returns positive number if frame1 is found to be 'greater' than frame2.
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_dup()

struct sr_koops_frame * sr_koops_frame_dup ( struct sr_koops_frame frame,
bool  siblings 
)

Creates a duplicate of the frame.

Parameters
frameIt must be non-NULL pointer. The frame is not modified by calling this function.
siblingsWhether to duplicate also siblings referenced by frame->next. If false, frame->next is not duplicated for the new frame, but it is set to NULL.
Returns
This function never returns NULL. The returned duplicate frame must be released by calling the function sr_koops_frame_free().
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_free()

void sr_koops_frame_free ( struct sr_koops_frame frame)

Releases the memory held by the frame. The frame siblings are not released.

Parameters
frameIf the frame is NULL, no operation is performed.
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_from_json()

struct sr_koops_frame * sr_koops_frame_from_json ( json_object *  root,
char **  error_message 
)

Deserializes frame structure from JSON representation.

Parameters
rootJSON value to be deserialized.
error_messageOn error, *error_message will contain the description of the error.
Returns
Resulting frame, or NULL on error.
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_init()

void sr_koops_frame_init ( struct sr_koops_frame frame)

Initializes all members of the frame structure to their default values. No memory is released, members are simply overwritten. This is useful for initializing a frame structure placed on the stack.

Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_new()

struct sr_koops_frame * sr_koops_frame_new ( void  )

Creates and initializes a new frame structure.

Returns
It never returns NULL. The returned pointer must be released by calling the function sr_koops_frame_free().
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.

◆ sr_koops_frame_to_json()

char * sr_koops_frame_to_json ( struct sr_koops_frame frame)

Returns a textual representation of the frame.

Parameters
frameIt must be a non-NULL pointer. It's not modified by calling this function.
Examples
/builddir/build/BUILD/satyr-0.42/include/koops/frame.h.