reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
trace_util.h
Go to the documentation of this file.
1
9#define LF_TRACE
10#include "reactor.h"
11#include "trace.h"
12
13/*
14 * String description of event types.
15 */
16extern const char* trace_event_names[];
17
22#define _LF_TRACE_FAILURE(trace_file) \
23 do { \
24 fprintf(stderr, "ERROR: Access to trace file failed.\n"); \
25 fclose(trace_file); \
26 trace_file = NULL; \
27 exit(1); \
28 } while (0)
29
34#define BUFFER_SIZE 1024
35
36/* Buffer for reading trace records. */
37extern trace_record_t trace[];
38
39/* File containing the trace binary data. */
40extern FILE* trace_file;
41
42/* File for writing the output data. */
43extern FILE* output_file;
44
45/* File for writing summary statistics. */
46extern FILE* summary_file;
47
52void usage();
53
54/* The start time read from the trace file. */
56
57/* Table of pointers to a description of the object. */
59extern int object_table_size;
60
61/* Name of the top-level reactor (first entry in symbol table). */
62extern char* top_level;
63
74char* root_name(const char* path);
75
85FILE* open_file(const char* path, const char* mode);
86
102char* get_object_description(void* reactor, int* index);
103
117char* get_trigger_name(void* trigger, int* index);
118
124
131size_t read_header();
132
int64_t instant_t
Time instant.
Definition tag.h:101
FILE * open_file(const char *path, const char *mode)
Open the specified file for reading or writing.
char * get_object_description(void *reactor, int *index)
Get the description of the object pointed to by the specified pointer.
void usage()
Print a usage message.
int read_trace()
Read the trace from the trace_file and put it in the trace global variable.
size_t read_header()
Read header information.
char * root_name(const char *path)
Return the root file name from the given path.
char * get_trigger_name(void *trigger, int *index)
Get the trigger name for the specified pointer.
void print_table()
Print the object to description table.
static const char * trace_event_names[]
String description of event types.
Definition trace_types.h:86
Definitions for the C target of Lingua Franca shared by threaded and unthreaded versions.
Definition trace.h:53
A trace record that gets written in binary to the trace file in the default implementation.
Definition tracepoint.h:52
API for the tracing module that records runtime events for debugging and analysis.
instant_t start_time
FILE * output_file
object_description_t * object_table
FILE * trace_file
int object_table_size
char * top_level
trace_record_t trace[]
FILE * summary_file