Classes | Macros | Typedefs | Functions | Variables
minitrace.cpp File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <atomic>
#include <signal.h>
#include <pthread.h>
#include <sys/time.h>
#include <unistd.h>
#include <inttypes.h>
#include "minitrace.h"
Include dependency graph for minitrace.cpp:

Go to the source code of this file.

Classes

struct  raw_event
 

Macros

#define __STDC_FORMAT_MACROS
 
#define ARRAY_SIZE(x)   sizeof(x)/sizeof(x[0])
 
#define ATTR_NORETURN
 
#define FALSE   0
 
#define STRING_POOL_SIZE   100
 
#define TRUE   1
 

Typedefs

typedef struct raw_event raw_event_t
 

Functions

static int get_cur_process_id ()
 
static int get_cur_thread_id ()
 
void internal_mtr_raw_event (const char *category, const char *name, char ph, void *id)
 
void internal_mtr_raw_event_arg (const char *category, const char *name, char ph, void *id, mtr_arg_type arg_type, const char *arg_name, void *arg_value)
 
void mtr_flush ()
 
void mtr_flush_with_state (int)
 
void mtr_init (const char *json_file)
 
void mtr_init_from_stream (void *stream)
 
const char * mtr_pool_string (const char *str)
 
void mtr_register_sigint_handler ()
 
void mtr_shutdown ()
 
void mtr_start ()
 
void mtr_stop ()
 
double mtr_time_s ()
 
static void termination_handler (int signum) ATTR_NORETURN
 

Variables

static int cur_process_id
 
static __thread int cur_thread_id
 
static raw_event_tevent_buffer
 
static std::atomic_int event_count
 
static pthread_mutex_t event_mutex
 
static int events_in_progress = 0
 
static FILE * f
 
static int first_line = 1
 
static raw_event_tflush_buffer
 
static int is_flushing = FALSE
 
static int is_tracing = FALSE
 
static pthread_mutex_t mutex
 
static char * str_pool [100]
 
static int64_t time_offset
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

Definition at line 32 of file minitrace.cpp.

◆ ARRAY_SIZE

#define ARRAY_SIZE (   x)    sizeof(x)/sizeof(x[0])

Definition at line 43 of file minitrace.cpp.

◆ ATTR_NORETURN

#define ATTR_NORETURN

Definition at line 40 of file minitrace.cpp.

◆ FALSE

#define FALSE   0

Definition at line 45 of file minitrace.cpp.

◆ STRING_POOL_SIZE

#define STRING_POOL_SIZE   100

Definition at line 80 of file minitrace.cpp.

◆ TRUE

#define TRUE   1

Definition at line 44 of file minitrace.cpp.

Typedef Documentation

◆ raw_event_t

typedef struct raw_event raw_event_t

Function Documentation

◆ get_cur_process_id()

static int get_cur_process_id ( )
inlinestatic

Definition at line 132 of file minitrace.cpp.

◆ get_cur_thread_id()

static int get_cur_thread_id ( )
inlinestatic

Definition at line 129 of file minitrace.cpp.

◆ internal_mtr_raw_event()

void internal_mtr_raw_event ( const char *  category,
const char *  name,
char  ph,
void *  id 
)

Definition at line 377 of file minitrace.cpp.

◆ internal_mtr_raw_event_arg()

void internal_mtr_raw_event_arg ( const char *  category,
const char *  name,
char  ph,
void *  id,
mtr_arg_type  arg_type,
const char *  arg_name,
void *  arg_value 
)

Definition at line 434 of file minitrace.cpp.

◆ mtr_flush()

void mtr_flush ( )

Definition at line 373 of file minitrace.cpp.

◆ mtr_flush_with_state()

void mtr_flush_with_state ( int  is_last)

Definition at line 265 of file minitrace.cpp.

◆ mtr_init()

void mtr_init ( const char *  json_file)

Definition at line 195 of file minitrace.cpp.

◆ mtr_init_from_stream()

void mtr_init_from_stream ( void *  stream)

Definition at line 178 of file minitrace.cpp.

◆ mtr_pool_string()

const char* mtr_pool_string ( const char *  str)

Definition at line 227 of file minitrace.cpp.

◆ mtr_register_sigint_handler()

void mtr_register_sigint_handler ( )

Definition at line 167 of file minitrace.cpp.

◆ mtr_shutdown()

void mtr_shutdown ( )

Definition at line 202 of file minitrace.cpp.

◆ mtr_start()

void mtr_start ( )

Definition at line 242 of file minitrace.cpp.

◆ mtr_stop()

void mtr_stop ( )

Definition at line 251 of file minitrace.cpp.

◆ mtr_time_s()

double mtr_time_s ( )

Definition at line 143 of file minitrace.cpp.

◆ termination_handler()

static void termination_handler ( int  signum)
static

Definition at line 156 of file minitrace.cpp.

Variable Documentation

◆ cur_process_id

int cur_process_id
static

Definition at line 76 of file minitrace.cpp.

◆ cur_thread_id

__thread int cur_thread_id
static

Definition at line 75 of file minitrace.cpp.

◆ event_buffer

raw_event_t* event_buffer
static

Definition at line 66 of file minitrace.cpp.

◆ event_count

std::atomic_int event_count
static

Definition at line 68 of file minitrace.cpp.

◆ event_mutex

pthread_mutex_t event_mutex
static

Definition at line 78 of file minitrace.cpp.

◆ events_in_progress

int events_in_progress = 0
static

Definition at line 71 of file minitrace.cpp.

◆ f

FILE* f
static

Definition at line 74 of file minitrace.cpp.

◆ first_line

int first_line = 1
static

Definition at line 73 of file minitrace.cpp.

◆ flush_buffer

raw_event_t* flush_buffer
static

Definition at line 67 of file minitrace.cpp.

◆ is_flushing

int is_flushing = FALSE
static

Definition at line 70 of file minitrace.cpp.

◆ is_tracing

int is_tracing = FALSE
static

Definition at line 69 of file minitrace.cpp.

◆ mutex

pthread_mutex_t mutex
static

Definition at line 77 of file minitrace.cpp.

◆ str_pool

char* str_pool[100]
static

Definition at line 81 of file minitrace.cpp.

◆ time_offset

int64_t time_offset
static

Definition at line 72 of file minitrace.cpp.



behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:18