satyr  0.28
Data Structures | Enumerations | Functions
thread.h File Reference

Thread. More...

#include <stdbool.h>
#include "report_type.h"

Go to the source code of this file.

Data Structures

struct  sr_thread
 

Enumerations

enum  sr_duphash_flags { SR_DUPHASH_NORMAL = 1 << 0, SR_DUPHASH_NOHASH = 1 << 1, SR_DUPHASH_NONORMALIZE = 1 << 2, SR_DUPHASH_KOOPS_COMPAT = 1 << 3 }
 

Functions

struct sr_framesr_thread_frames (struct sr_thread *thread)
 
void sr_thread_set_frames (struct sr_thread *thread, struct sr_frame *frames)
 
int sr_thread_frame_count (struct sr_thread *thread)
 
int sr_thread_cmp (struct sr_thread *t1, struct sr_thread *t2)
 
struct sr_threadsr_thread_next (struct sr_thread *thread)
 
void sr_thread_set_next (struct sr_thread *cur, struct sr_thread *next)
 
void sr_thread_free (struct sr_thread *thread)
 
bool sr_thread_remove_frame (struct sr_thread *thread, struct sr_frame *frame)
 
bool sr_thread_remove_frames_above (struct sr_thread *thread, struct sr_frame *frame)
 
struct sr_threadsr_thread_dup (struct sr_thread *thread)
 
void sr_thread_normalize (struct sr_thread *thread)
 
char * sr_thread_get_duphash (struct sr_thread *thread, int frames, char *prefix, enum sr_duphash_flags flags)
 

Detailed Description

Thread.

Definition in file thread.h.

Enumeration Type Documentation

◆ sr_duphash_flags

Flags that influence how the duphash is computed.

Definition at line 59 of file thread.h.

Function Documentation

◆ sr_thread_cmp()

int sr_thread_cmp ( struct sr_thread t1,
struct sr_thread t2 
)

Compares two threads. Returns 0 on equality. Threads of distinct type are always unequal.

◆ sr_thread_dup()

struct sr_thread* sr_thread_dup ( struct sr_thread thread)

Return a copy of the thread (without its siblings).

◆ sr_thread_frame_count()

int sr_thread_frame_count ( struct sr_thread thread)

Returns the number of frames in the thread.

◆ sr_thread_frames()

struct sr_frame* sr_thread_frames ( struct sr_thread thread)

Returns pointer to the first frame in thread.

◆ sr_thread_free()

void sr_thread_free ( struct sr_thread thread)

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

Parameters
threadIf thread is NULL, no operation is performed.

◆ sr_thread_get_duphash()

char* sr_thread_get_duphash ( struct sr_thread thread,
int  frames,
char *  prefix,
enum sr_duphash_flags  flags 
)

Returns the duplication hash. Two threads resulting from the same crash should have the same duphash. The returned string is allocated by malloc().

Parameters
threadThe thread to hash.
framesNumber of frames to include in the hash. If the value is 0, all frames are used.
prefixString that should be prefixed before the text from which the hash is computed. ABRT/FAF used the crash component here. Can be NULL.
flagsBitwise OR of sr_duphash_flags.

◆ sr_thread_next()

struct sr_thread* sr_thread_next ( struct sr_thread thread)

Next thread in linked list (same as reading the "next" structure member).

◆ sr_thread_normalize()

void sr_thread_normalize ( struct sr_thread thread)

Normalizes thread for deduplication/clustering. The normalization consists of removing useless frames and changing names of others.

◆ sr_thread_remove_frame()

bool sr_thread_remove_frame ( struct sr_thread thread,
struct sr_frame frame 
)

Removes the frame from the thread and then deletes it.

Returns
True if the frame was found in the thread and removed and deleted. False if the frame was not found in the thread.

◆ sr_thread_remove_frames_above()

bool sr_thread_remove_frames_above ( struct sr_thread thread,
struct sr_frame frame 
)

Removes all the frames from the thread that are above certain frame.

Returns
True if the frame was found, and all the frames that were above the frame in the thread were removed from the thread and then deleted. False if the frame was not found in the thread.

◆ sr_thread_set_frames()

void sr_thread_set_frames ( struct sr_thread thread,
struct sr_frame frames 
)

Set the frame linked list pointer.

◆ sr_thread_set_next()

void sr_thread_set_next ( struct sr_thread cur,
struct sr_thread next 
)

Set the next pointer.