litl  0.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros | Functions
litl_read.h File Reference

litl_read Provides a set of functions for reading events from a regular trace file or an archive of traces More...

#include "litl_types.h"

Go to the source code of this file.

Macros

#define __LITL_READ_INIT_PTR(evt, _ptr_)
 
#define __LITL_READ_GET_ARG(evt, _ptr_, arg)
 
#define __LITL_READ_GET_ARG_REGULAR(_ptr_, arg)
 
#define __LITL_READ_GET_ARG_PACKED(_ptr_, arg)
 
#define LITL_READ_GET_CUR_EVENT_PER_THREAD(process, thread_index)   (&(process)->threads[(thread_index)]->cur_event)
 Returns a current event of a given thread. More...
 
#define LITL_READ_GET_CUR_EVENT(process)   LITL_READ_GET_CUR_EVENT_PER_THREAD(process, (process)->cur_index)
 Returns a current event of a given trace. More...
 
#define LITL_READ_GET_TID(read_event)   (read_event)->tid
 Returns a thread id of a given event. More...
 
#define LITL_READ_GET_TIME(read_event)   (read_event)->event->time
 Returns a time stamp of a given event. More...
 
#define LITL_READ_GET_TYPE(read_event)   (read_event)->event->type
 Returns a type of a given event. More...
 
#define LITL_READ_GET_CODE(read_event)   (read_event)->event->code
 Returns a code of a given event. More...
 
#define LITL_READ_RAW(read_event)   (&(read_event)->event->parameters.raw)
 Returns a size and parameters in the string format of a raw event. More...
 
#define LITL_READ_REGULAR(read_event)   (&(read_event)->event->parameters.regular)
 Returns a size and a list of parameters of a regular event. More...
 
#define LITL_READ_PACKED(read_event)   (&(read_event)->event->parameters.packed)
 Returns a size and a list of parameters of a packed event. More...
 
#define LITL_READ_OFFSET(read_event)   (&(read_event)->event->parameters.offset)
 Returns a size and an offset of an event of type offset. More...
 
#define litl_read_get_param_1(p_evt,param1)
 Assigns the first parameter of p_evt to param1. More...
 
#define litl_read_get_param_2(p_evt,param1,param2)
 Assigns the first 2 parameters of p_evt to param1 and param2. More...
 
#define litl_read_get_param_3(p_evt,param1,param2,param3)
 Assigns the first 3 parameters of p_evt to param1, ..., param3. More...
 
#define litl_read_get_param_4(p_evt,param1,param2,param3,param4)
 Assigns the first 4 parameters of p_evt to param1, ..., param4. More...
 
#define litl_read_get_param_5(p_evt,param1,param2,param3,param4,param5)
 Assigns the first 5 parameters of p_evt to param1, ..., param5. More...
 
#define litl_read_get_param_6(p_evt,param1,param2,param3,param4,param5,param6)
 Assigns the first 6 parameters of p_evt to param1, ..., param6. More...
 
#define litl_read_get_param_7(p_evt,param1,param2,param3,param4,param5,param6,param7)
 Assigns the first 7 parameters of p_evt to param1, ..., param7. More...
 
#define litl_read_get_param_8(p_evt,param1,param2,param3,param4,param5,param6,param7,param8)
 Assigns the first 8 parameters of p_evt to param1, ..., param8. More...
 
#define litl_read_get_param_9(p_evt,param1,param2,param3,param4,param5,param6,param7,param8,param9)
 Assigns the first 9 parameters of p_evt to param1, ..., param9. More...
 
#define litl_read_get_param_10(p_evt,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10)
 Assigns the first 10 parameters of p_evt to param1, ..., param10. More...
 

Functions

litl_read_trace_tlitl_read_open_trace (const char *filename)
 Opens a trace and reads the first portion of data (trace header) to the buffer. More...
 
void litl_read_init_processes (litl_read_trace_t *trace)
 Initializes the event reading structure. More...
 
litl_general_header_tlitl_read_get_trace_header (litl_read_trace_t *trace)
 Returns a pointer to the trace header. More...
 
litl_process_header_tlitl_read_get_process_header (litl_read_process_t *process)
 Returns a pointer to the process header. More...
 
void litl_read_set_buffer_size (litl_read_trace_t *trace, const litl_size_t buf_size)
 Sets the buffer size. More...
 
litl_size_t litl_read_get_buffer_size (litl_read_trace_t *trace)
 Returns the buffer size. More...
 
void litl_read_reset_process (litl_read_process_t *process)
 Resets the trace pointer. More...
 
litl_read_event_tlitl_read_next_process_event (litl_read_trace_t *trace, litl_read_process_t *process)
 Reads the next event from a trace. More...
 
litl_read_event_tlitl_read_next_event (litl_read_trace_t *trace)
 Reads the next event from a trace file. More...
 
void litl_read_finalize_trace (litl_read_trace_t *trace)
 Closes the trace and frees the allocated memory. More...
 

Detailed Description

litl_read Provides a set of functions for reading events from a regular trace file or an archive of traces

Authors
Developers are:
Roman Iakymchuk – roman.nosp@m..iak.nosp@m.ymchu.nosp@m.k@te.nosp@m.lecom.nosp@m.-sud.nosp@m.paris.nosp@m..eu
Francois Trahay – franc.nosp@m.ois..nosp@m.traha.nosp@m.y@te.nosp@m.lecom.nosp@m.-sud.nosp@m.paris.nosp@m..eu

Definition in file litl_read.h.

Macro Definition Documentation

#define __LITL_READ_GET_ARG (   evt,
  _ptr_,
  arg 
)
Value:
do { \
} while(0)
#define LITL_READ_GET_TYPE(read_event)
Returns a type of a given event.
Definition: litl_read.h:200
#define __LITL_READ_GET_ARG_REGULAR(_ptr_, arg)
Definition: litl_read.h:151
#define __LITL_READ_GET_ARG_PACKED(_ptr_, arg)
Definition: litl_read.h:160

Definition at line 139 of file litl_read.h.

#define __LITL_READ_GET_ARG_PACKED (   _ptr_,
  arg 
)
Value:
do { \
memcpy(&arg, _ptr_, sizeof(arg)); \
_ptr_ = ((char*)_ptr_)+sizeof(arg); \
} while(0)

Definition at line 160 of file litl_read.h.

#define __LITL_READ_GET_ARG_REGULAR (   _ptr_,
  arg 
)
Value:
do { \
arg = (typeof(arg)) *(litl_param_t*)_ptr_; \
(litl_param_t*)_ptr_++; \
} while(0)
uint64_t litl_param_t
A data type for the non-optimized storage of parameters.
Definition: litl_types.h:122

Definition at line 151 of file litl_read.h.

#define __LITL_READ_INIT_PTR (   evt,
  _ptr_ 
)
Value:
do { \
_ptr_ = &LITL_READ_REGULAR(evt)->param[0]; \
else \
_ptr_ = &LITL_READ_PACKED(evt)->param[0]; \
} while(0)
#define LITL_READ_PACKED(read_event)
Returns a size and a list of parameters of a packed event.
Definition: litl_read.h:225
#define LITL_READ_GET_TYPE(read_event)
Returns a type of a given event.
Definition: litl_read.h:200
#define LITL_READ_REGULAR(read_event)
Returns a size and a list of parameters of a regular event.
Definition: litl_read.h:219

Definition at line 127 of file litl_read.h.