reactor-c
C Runtime for Lingua Franca
|
#include <stdio.h>
#include <string.h>
#include "reactor.h"
#include "trace.h"
#include "trace_util.h"
#include "trace_impl.h"
Data Structures | |
struct | reaction_stats_t |
struct | summary_stats_t |
Macros | |
#define | LF_TRACE |
#define | MAX_NUM_REACTIONS 64 |
#define | MAX_NUM_WORKERS 64 |
Typedefs | |
typedef struct reaction_stats_t | reaction_stats_t |
typedef struct summary_stats_t | summary_stats_t |
Functions | |
void | usage () |
size_t | read_and_write_trace (instant_t trace_start_time, instant_t trace_end_time) |
void | write_summary_file () |
instant_t | string_to_instant (const char *time_spec, const char *units) |
int | process_args (int argc, const char *argv[], char **root, instant_t *start_time, instant_t *end_time) |
int | main (int argc, const char *argv[]) |
Variables | |
FILE * | trace_file = NULL |
FILE * | output_file = NULL |
FILE * | summary_file = NULL |
int | table_size |
summary_stats_t ** | summary_stats |
instant_t | latest_time = 0LL |
Copyright (c) 2020, The University of California at Berkeley
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Standalone program to convert a Lingua Franca trace file to a comma-separated values text file.
#define LF_TRACE |
#define MAX_NUM_REACTIONS 64 |
#define MAX_NUM_WORKERS 64 |
typedef struct reaction_stats_t reaction_stats_t |
Struct for collecting summary statistics for reaction invocations.
typedef struct summary_stats_t summary_stats_t |
Struct for collecting summary statistics.
int main | ( | int | argc, |
const char * | argv[] ) |
int process_args | ( | int | argc, |
const char * | argv[], | ||
char ** | root, | ||
instant_t * | start_time, | ||
instant_t * | end_time ) |
Read a trace in the trace_file and write it to the output_file as CSV.
instant_t string_to_instant | ( | const char * | time_spec, |
const char * | units ) |
void usage | ( | ) |
Print a usage message.
void write_summary_file | ( | ) |
Write the summary file.
instant_t latest_time = 0LL |
Largest timestamp seen.
FILE* output_file = NULL |
File for writing the output data.
FILE* summary_file = NULL |
File for writing summary statistics.
summary_stats_t** summary_stats |
Summary stats array. This array has the same size as the object table. Pointer in the array will be void if there are no stats for the object table item.
int table_size |
Size of the stats table is object_table_size plus twice MAX_NUM_WORKERS.
FILE* trace_file = NULL |
File containing the trace binary data.