summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-07-14 16:49:27 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-07-14 16:49:27 +0200
commit0a7917342cf27f18f553afdf4a65d6377f671aad (patch)
tree4fb33948a2d927147b214de84171bb2075811f5c
parentb5f7fd47d1ee66f20af50fae145990d4665b56c3 (diff)
support more than one logfile per measurement runfeature/lennart/get_files_array
-rwxr-xr-xbin/generate-dfa-benchmark.py4
-rw-r--r--lib/loader.py12
2 files changed, 9 insertions, 7 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py
index fdfac35..6540702 100755
--- a/bin/generate-dfa-benchmark.py
+++ b/bin/generate-dfa-benchmark.py
@@ -393,7 +393,7 @@ def run_benchmark(
os.remove(filename)
harness.undo(i)
else:
- files.extend(monitor.get_files())
+ files.append(monitor.get_files())
i += 1
harness.restart()
@@ -680,7 +680,7 @@ if __name__ == "__main__":
"files": list(map(lambda x: x[3], results)),
"configs": list(map(lambda x: x[2].get_config(), results)),
}
- extra_files = flatten(json_out["files"])
+ extra_files = flatten(map(flatten, json_out["files"]))
if "instance" in pta.codegen:
output_prefix = (
opt["data"] + time.strftime("/%Y%m%d-%H%M%S-") + pta.codegen["instance"]
diff --git a/lib/loader.py b/lib/loader.py
index 65d497b..4934316 100644
--- a/lib/loader.py
+++ b/lib/loader.py
@@ -974,14 +974,16 @@ class RawData:
"state_duration": ptalog["opt"]["sleep"],
}
)
- for repeat_id, etlog_file in enumerate(ptalog["files"][j]):
- member = tf.getmember(etlog_file)
+ for repeat_id, etlog_files in enumerate(ptalog["files"][j]):
+ members = list(map(tf.getmember, etlog_files))
offline_data.append(
{
- "content": tf.extractfile(member).read(),
+ "content": list(
+ map(lambda f: tf.extractfile(f).read(), members)
+ ),
"sync_mode": sync_mode,
"fileno": j,
- "info": member,
+ "info": members[0],
"setup": self.setup_by_fileno[j],
"repeat_id": repeat_id,
"expected_trace": ptalog["traces"][j],
@@ -1238,7 +1240,7 @@ class EnergyTraceWithBarcode:
)
return list()
- lines = log_data.decode("ascii").split("\n")
+ lines = log_data[0].decode("ascii").split("\n")
data_count = sum(map(lambda x: len(x) > 0 and x[0] != "#", lines))
data_lines = filter(lambda x: len(x) > 0 and x[0] != "#", lines)