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

Updated Makefile and docs for fedsd utility #262

Merged
merged 18 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
17 changes: 10 additions & 7 deletions util/tracing/Makefile
lhstrh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Makefile for utilities that convert Lingua Franca trace files
# into other formats.
# @author: Edward A. Lee
REACTOR_C=../../
REACTOR_C=../..
CURRENT_PATH=$(shell pwd)
CC=gcc
CFLAGS= -I$(REACTOR_C)/include/core/ \
-I$(REACTOR_C)/include/core/modal_models \
Expand All @@ -12,7 +13,8 @@ CFLAGS= -I$(REACTOR_C)/include/core/ \
DEPS=
LIBS=-lcurl

INSTALL_PREFIX ?= /usr/local/bin
INSTALL_PREFIX ?= /usr/local
BIN_INSTALL_PATH = $(INSTALL_PREFIX)/bin

%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
Expand All @@ -27,11 +29,12 @@ 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
cp trace_to_csv $(BIN_INSTALL_PATH)
cp trace_to_chrome $(BIN_INSTALL_PATH)
cp trace_to_influxdb $(BIN_INSTALL_PATH)
cp ./visualization/fedsd.py $(BIN_INSTALL_PATH)
ln -f -s $(BIN_INSTALL_PATH)/fedsd.py $(BIN_INSTALL_PATH)/fedsd
chmod +x $(BIN_INSTALL_PATH)/fedsd

clean:
rm -f *.o
102 changes: 0 additions & 102 deletions util/tracing/launch-fedsd.sh

This file was deleted.

22 changes: 14 additions & 8 deletions util/tracing/visualization/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Trace sequence diagram visualizer

`fedsd` is a utility that reports the interactions (exchanged messages)
between federates and the RTI in a sequence-diagram-like format.
between federates and the RTI in a sequence-diagram-like format.
It also reports the interactions between different encalves in an enclaved execution, where no RTI trace file is provided.


To use `fedsd`, you need to first obtain an execution trace. To do this, enable the tracing mechanism in your Lingua Franca program by setting the `tracing` target property to `true` and then compile and run the program.

Expand All @@ -10,7 +12,7 @@ internally running `trace_to_csv`. It then aggregates the data from all `.csv`
files to do the matching and draw the sequence diagram.

# Installing
`fedsd` is installed together with the rest of the tracing tools. For instructions refer to `~/util/tracing/README.md`.
`fedsd` is installed together with the rest of the tracing tools. For instructions refer to `util/tracing/README.md`.


# Running
Expand All @@ -20,16 +22,20 @@ file will be generated for each of the federates, in addition to `rti.lft`. The
contains the RTI trace.

If, however, the federation is launched manually, then running the `RTI` command should be passed the `-t` flag in order to make sure that it, too, has tracing enabled:
```
$ RTI -n <number_of_federates> -t
```bash
RTI -n <number_of_federates> -t
```

It is most convenient to launch the RTI and all federates from the same working directory so that they will all write their trace file to that directory.

Once the federation stopped executing, run `fedsd` on all generated `.lft` files:
Once the federation stopped executing, running `fedsd` will operate on all the `.lft` files in the current directory:
```bash
fedsd
```
$ fedsd *.lft
It is also possible to operate on specific files. In such a case, run `fedsd` with `-r` flag to provide the RTI trace file, and `-f` flag to privide the list of federates
trace files. Bith argumenets are optional.
```bash
fedsd -r <rti.lft> -f <federate__f1.lft> <federate__f2.lft>
```

The output is an html file named `trace_svg.html` (in the current directory) that contains the sequence of interactions
between the federates and the RTI.
The output is an html file named `trace_svg.html` (in the current directory) that contains the sequence of interactions between the federates and the RTI.
Loading
Loading