reactor-c
1.0
C Runtime for Lingua Franca
Toggle main menu visibility
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
*/
16
extern
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. */
37
extern
trace_record_t
trace
[];
38
39
/* File containing the trace binary data. */
40
extern
FILE*
trace_file
;
41
42
/* File for writing the output data. */
43
extern
FILE*
output_file
;
44
45
/* File for writing summary statistics. */
46
extern
FILE*
summary_file
;
47
52
void
usage
();
53
54
/* The start time read from the trace file. */
55
extern
instant_t
start_time
;
56
57
/* Table of pointers to a description of the object. */
58
extern
object_description_t
*
object_table
;
59
extern
int
object_table_size
;
60
61
/* Name of the top-level reactor (first entry in symbol table). */
62
extern
char
*
top_level
;
63
74
char
*
root_name
(
const
char
* path);
75
85
FILE*
open_file
(
const
char
* path,
const
char
* mode);
86
102
char
*
get_object_description
(
void
* reactor,
int
* index);
103
117
char
*
get_trigger_name
(
void
* trigger,
int
* index);
118
123
void
print_table
();
124
131
size_t
read_header
();
132
139
int
read_trace
();
instant_t
int64_t instant_t
Time instant.
Definition
tag.h:101
open_file
FILE * open_file(const char *path, const char *mode)
Open the specified file for reading or writing.
get_object_description
char * get_object_description(void *reactor, int *index)
Get the description of the object pointed to by the specified pointer.
usage
void usage()
Print a usage message.
read_trace
int read_trace()
Read the trace from the trace_file and put it in the trace global variable.
read_header
size_t read_header()
Read header information.
root_name
char * root_name(const char *path)
Return the root file name from the given path.
get_trigger_name
char * get_trigger_name(void *trigger, int *index)
Get the trigger name for the specified pointer.
print_table
void print_table()
Print the object to description table.
trace_event_names
static const char * trace_event_names[]
String description of event types.
Definition
trace_types.h:88
reactor.h
Definitions for the C target of Lingua Franca shared by threaded and unthreaded versions.
object_description_t
Definition
trace.h:53
trace_record_t
A trace record that gets written in binary to the trace file in the default implementation.
Definition
tracepoint.h:52
trace.h
API for the tracing module that records runtime events for debugging and analysis.
start_time
instant_t start_time
output_file
FILE * output_file
object_table
object_description_t * object_table
trace_file
FILE * trace_file
object_table_size
int object_table_size
top_level
char * top_level
trace
trace_record_t trace[]
summary_file
FILE * summary_file
Users
runner
work
reactor-c
reactor-c
util
tracing
trace_util.h
Generated on
for reactor-c by
1.17.0