summaryrefslogtreecommitdiff
path: root/lib/loader.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-11-16 14:36:50 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-11-16 14:36:50 +0100
commit89d564fa6a6ed7f97d8b0f0201b1424340f21c27 (patch)
treec810152678a0100c89edbab5d44e55b0e051984a /lib/loader.py
parentc16163f5bcea9df186c04c9820abe1d3f509b023 (diff)
do not parse energytrace logs with large sync offset
Diffstat (limited to 'lib/loader.py')
-rw-r--r--lib/loader.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/loader.py b/lib/loader.py
index 4cb5dc0..e5e8746 100644
--- a/lib/loader.py
+++ b/lib/loader.py
@@ -121,6 +121,7 @@ def _preprocess_etlog(measurement):
measurement["transition_names"],
with_traces=measurement["with_traces"],
)
+ states_and_transitions = list()
try:
etlog.load_data(measurement["content"])
states_and_transitions = etlog.analyze_states(
@@ -128,6 +129,8 @@ def _preprocess_etlog(measurement):
)
except EOFError as e:
etlog.errors.append("EnergyTrace logfile error: {}".format(e))
+ except RuntimeError as e:
+ etlog.errors.append("EnergyTrace loader error: {}".format(e))
processed_data = {
"fileno": measurement["fileno"],
@@ -1738,10 +1741,11 @@ class EnergyTraceWithLogicAnalyzer:
state_sleep=self.state_duration, with_traces=self.with_traces
)
# Uncomment to plot traces
- if offline_index == 0 and os.getenv("DFATOOL_PLOT_LASYNC") is not None:
+ if os.getenv("DFATOOL_PLOT_LASYNC") is not None and offline_index == int(
+ os.getenv("DFATOOL_PLOT_LASYNC")
+ ):
dp.plot() # <- plot traces with sync annotatons
# dp.plot(names) # <- plot annotated traces (with state/transition names)
- pass
if os.getenv("DFATOOL_EXPORT_LASYNC") is not None:
filename = os.getenv("DFATOOL_EXPORT_LASYNC") + f"_{offline_index}.json"
with open(filename, "w") as f: