Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracing utils moved into reactor-c #259

Merged
merged 6 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build-trace-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build the tracing tools

on:
workflow_call:

jobs:
run:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Check out reactor-c repository
uses: actions/checkout@v3
- name: Building tracing utils
working-directory: ./util/tracing
run: make
shell: bash
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
build-rti:
uses: lf-lang/reactor-c/.github/workflows/build-rti.yml@main

build-trace-tools:
uses: lf-lang/reactor-c/.github/workflows/build-trace-tools.yml@move-tracing-utils
lhstrh marked this conversation as resolved.
Show resolved Hide resolved

fetch-lf:
uses: lf-lang/lingua-franca/.github/workflows/extract-ref.yml@master
with:
Expand Down
37 changes: 37 additions & 0 deletions util/tracing/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Makefile for utilities that convert Lingua Franca trace files
# into other formats.
# @author: Edward A. Lee
REACTOR_C=../../
CC=gcc
CFLAGS= -I$(REACTOR_C)/include/core/ \
-I$(REACTOR_C)/include/core/modal_models \
-I$(REACTOR_C)/include/core/platform \
-I$(REACTOR_C)/include/core/utils \
-DLF_UNTHREADED=1 \
-Wall
DEPS=
LIBS=-lcurl

INSTALL_PREFIX ?= /usr/local/bin

%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)

trace_to_csv: trace_to_csv.o trace_util.o
$(CC) -o trace_to_csv trace_to_csv.o trace_util.o

trace_to_chrome: trace_to_chrome.o trace_util.o
$(CC) -o trace_to_chrome trace_to_chrome.o trace_util.o

trace_to_influxdb: trace_to_influxdb.o trace_util.o
$(CC) -o trace_to_influxdb trace_to_influxdb.o trace_util.o $(LIBS)

install: trace_to_csv trace_to_chrome trace_to_influxdb
mv trace_to_csv $(INSTALL_PREFIX)
mv trace_to_chrome $(INSTALL_PREFIX)
mv trace_to_influxdb $(INSTALL_PREFIX)
ln -f -s launch-fedsd.sh $(INSTALL_PREFIX)/fedsd
chmod +x launch-fedsd.sh

clean:
rm -f *.o
30 changes: 30 additions & 0 deletions util/tracing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## util/tracing

This directory contains the source code for utilities that are standalone executables
for post-processing tracing data created by the tracing function in Lingua Franca.

Utilities for visualizing the data are contained in the [visualization](visualization/README.md)
directory.

* trace\_to\_csv: Creates a comma-separated values text file from a binary trace file.
The resulting file is suitable for analyzing in spreadsheet programs such as Excel.

* trace\_to\_chrome: Creates a JSON file suitable for importing into Chrome's trace
visualizer. Point Chrome to chrome://tracing/ and load the resulting file.

* trace\_to\_influxdb: A preliminary implementation that takes a binary trace file
and uploads its data into [InfluxDB](https://en.wikipedia.org/wiki/InfluxDB).

* fedsd: A utility that converts trace files from a federate into sequence diagrams
showing the interactions between federates and the RTI.

## Installing

```
sudo make install
```
Will install the tracing executables to `/usr/local/bin` to install them to a different location, use the `INSTALL_PREFIX` flag, e.g.

```
make install INSTALL_PREFIX=~/.local/bin
```
Loading
Loading