reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
trace_impl.c File Reference
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "trace.h"
#include "platform.h"
#include "logging_macros.h"
#include "trace_impl.h"

Macros

#define _LF_TRACE_FAILURE(trace)
 

Functions

const version_tlf_version_tracing ()
 Return a description of the compile-time properties of the current plugin.
 
void lf_tracing_register_trace_event (object_description_t description)
 Register a kind of trace event. This should be called before tracepoints are reached.
 
void lf_tracing_tracepoint (int worker, trace_record_nodeps_t *tr)
 Submit a tracepoint from the given worker to the tracing module.
 
void lf_tracing_global_init (char *process_name, char *process_names, int fedid, int max_num_local_threads)
 Initialize the tracing module. Calling other API functions before calling this procedure is undefined behavior.
 
void lf_tracing_set_start_time (int64_t time)
 Give the tracing module access to the start time. This may be invoked after many tracepoints have already been recorded but should be invoked early.
 
void lf_tracing_global_shutdown ()
 Shut down the tracing module. Calling other API functions after calling this procedure is undefined behavior.
 

Macro Definition Documentation

◆ _LF_TRACE_FAILURE

#define _LF_TRACE_FAILURE ( trace)
Value:
do { \
fprintf(stderr, "WARNING: Access to trace file failed.\n"); \
fclose(trace->_lf_trace_file); \
trace->_lf_trace_file = NULL; \
return -1; \
} while (0)
FILE * _lf_trace_file
Definition trace_impl.h:35

Macro to use when access to trace file fails.

Function Documentation

◆ lf_tracing_global_init()

void lf_tracing_global_init ( char * process_name,
char * process_names,
int process_id,
int max_num_local_threads )

Initialize the tracing module. Calling other API functions before calling this procedure is undefined behavior.

Parameters
process_nameThe name of the current federate, or a placeholder if this is not a federate.
process_namesThe names of all federates, separated by commas, or NULL if that information is not available.
process_idThe ID of the current federate, or -1 if this is the RTI. 0 if unfederated.
max_num_local_threadsAn upper bound on the number of threads created by this process.

◆ lf_tracing_global_shutdown()

void lf_tracing_global_shutdown ( )

Shut down the tracing module. Calling other API functions after calling this procedure is undefined behavior.

◆ lf_tracing_register_trace_event()

void lf_tracing_register_trace_event ( object_description_t description)

Register a kind of trace event. This should be called before tracepoints are reached.

Parameters
descriptionA description of some trace events which may be received in the future. This may be invoked after many tracepoints have already been recorded but should be invoked early.

◆ lf_tracing_set_start_time()

void lf_tracing_set_start_time ( int64_t time)

Give the tracing module access to the start time. This may be invoked after many tracepoints have already been recorded but should be invoked early.

◆ lf_tracing_tracepoint()

void lf_tracing_tracepoint ( int worker,
trace_record_nodeps_t * tr )

Submit a tracepoint from the given worker to the tracing module.

◆ lf_version_tracing()

const version_t * lf_version_tracing ( )

Return a description of the compile-time properties of the current plugin.