Single thread of execution of a core stack trace.
More...
#include "../report_type.h"
#include <stdbool.h>
#include <inttypes.h>
Go to the source code of this file.
Single thread of execution of a core stack trace.
Definition in file core/thread.h.
◆ sr_core_thread_append()
Appends 'item' at the end of the list 'dest'.
- Returns
- This function returns the 'dest' thread. If 'dest' is NULL, it returns the 'item' frame.
◆ sr_core_thread_cmp()
Compares two threads. When comparing the threads, it compares also their frames, including the frame numbers.
- Returns
- Returns 0 if the threads are same. Returns negative number if t1 is found to be 'less' than t2. Returns positive number if t1 is found to be 'greater' than t2.
◆ sr_core_thread_dup()
Creates a duplicate of the thread.
- Parameters
-
thread | It must be non-NULL pointer. The thread is not modified by calling this function. |
siblings | Whether to duplicate also siblings referenced by thread->next. If false, thread->next is not duplicated for the new frame, but it is set to NULL. |
◆ sr_core_thread_free()
Releases the memory held by the thread. The thread siblings are not released. Thread frames are released.
- Parameters
-
thread | If thread is NULL, no operation is performed. |
◆ sr_core_thread_from_json()
Deserializes thread from JSON representation.
- Parameters
-
root | JSON value to be deserialized. |
error_message | On error, *error_message will contain the description of the error. |
- Returns
- Resulting thread, or NULL on error.
◆ sr_core_thread_init()
Initializes all members of the thread to default values. No memory is released, members are simply overwritten. This is useful for initializing a thread structure placed on the stack.
◆ sr_core_thread_new()
Creates and initializes a new frame structure.
- Returns
- It never returns NULL. The returned pointer must be released by calling the function sr_core_thread_free().