Commit a90394e5 authored by Joanne Hugé's avatar Joanne Hugé

Add cyclictest measures and fix small mistakes in the script

parent a3dc15ae
...@@ -29,6 +29,14 @@ class MeasureSetHandler: ...@@ -29,6 +29,14 @@ class MeasureSetHandler:
return s return s
def save(self): def save(self):
remove_list = []
for mtype in self.measure_sets:
if len(self.measure_sets[mtype]['ids']) == 0:
remove_list.append(mtype)
for mtype in remove_list:
del self.measure_sets[mtype]
with open(MeasureSetHandler.measure_sets_path, 'w') as measure_sets_file: with open(MeasureSetHandler.measure_sets_path, 'w') as measure_sets_file:
json.dump(self.measure_sets, measure_sets_file) json.dump(self.measure_sets, measure_sets_file)
...@@ -57,7 +65,6 @@ class MeasureSetHandler: ...@@ -57,7 +65,6 @@ class MeasureSetHandler:
print("Saved measure as {}{}".format(mtype, next_id)) print("Saved measure as {}{}".format(mtype, next_id))
def remove_measure_set(self, mtype, mid): def remove_measure_set(self, mtype, mid):
if mtype in self.measure_sets and len(self.measure_sets[mtype]['ids']) > 0: if mtype in self.measure_sets and len(self.measure_sets[mtype]['ids']) > 0:
self.measure_sets[mtype]['ids'].remove(mid) self.measure_sets[mtype]['ids'].remove(mid)
measure_file_name = "{}/{}{}.json".format(MeasureSetHandler.measures_dir, mtype, mid) measure_file_name = "{}/{}{}.json".format(MeasureSetHandler.measures_dir, mtype, mid)
...@@ -289,7 +296,7 @@ class MeasureSet: ...@@ -289,7 +296,7 @@ class MeasureSet:
enumerate_prop = list(enumerate(prop)) enumerate_prop = list(enumerate(prop))
self.max.append(max(list(map(lambda x: x[0] if x[1] else 0, enumerate_prop)))) self.max.append(max(list(map(lambda x: x[0] if x[1] else 0, enumerate_prop))))
self.min.append(max(map(lambda x: x[0] if x[1] else 0, enumerate_prop))) self.min.append(min(map(lambda x: x[0] if x[1] else 0, enumerate_prop)))
sum_prop = sum(prop) sum_prop = sum(prop)
...@@ -379,7 +386,7 @@ class MeasureSet: ...@@ -379,7 +386,7 @@ class MeasureSet:
vals = list(map(lambda x: min_val if x != 0 and x < min_val else x, vals)) vals = list(map(lambda x: min_val if x != 0 and x < min_val else x, vals))
plt.bar(bins, vals) plt.bar(bins, vals, alpha=0.4)
def generate_chrono_graph(self, i, color): def generate_chrono_graph(self, i, color):
prop = self.props[i] prop = self.props[i]
...@@ -436,6 +443,7 @@ def parse_args(): ...@@ -436,6 +443,7 @@ def parse_args():
parser = argparse.ArgumentParser(description='Measure analysis') parser = argparse.ArgumentParser(description='Measure analysis')
parser.add_argument('-i', nargs=1, required=False, help='import file') parser.add_argument('-i', nargs=1, required=False, help='import file')
parser.add_argument('-c', action='store_true', required=False, help='parse cyclictest histogram') parser.add_argument('-c', action='store_true', required=False, help='parse cyclictest histogram')
parser.add_argument('--remove', nargs=1, required=False, help='remove a measure')
parser.add_argument('--remove-all', action='store_true', help='remove all measure sets') parser.add_argument('--remove-all', action='store_true', help='remove all measure sets')
parser.add_argument('-t', nargs='?', const='input_file', required=False, help='generate table') parser.add_argument('-t', nargs='?', const='input_file', required=False, help='generate table')
parser.add_argument('-R', action='store_true', required=False, help='generate full measure report') parser.add_argument('-R', action='store_true', required=False, help='generate full measure report')
...@@ -445,6 +453,19 @@ def parse_args(): ...@@ -445,6 +453,19 @@ def parse_args():
args = parser.parse_args() args = parser.parse_args()
ms_handler = MeasureSetHandler() ms_handler = MeasureSetHandler()
if args.remove is not None:
file_name = args.remove[0]
mid_start = 0
for c in range(len(file_name)-1, -1, -1):
if not str.isdigit(file_name[c]):
mid_start = c+1
break
mtype = file_name[:mid_start]
mid = int(file_name[mid_start:])
ms_handler.remove_measure_set(mtype, mid)
if args.i is not None: if args.i is not None:
measure_set = MeasureSet() measure_set = MeasureSet()
......
{"measure_type": "cyclictest_wake-up_latency", "props_names": ["wake-up latency"], "units": ["us"], "props": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 71354, 227648, 2119727, 18949203, 57902118, 83646995, 73486890, 51000779, 35574312, 25745841, 17325399, 10116697, 5008749, 2095840, 741363, 226972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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "props_type": "histogram", "metadata": {"board": "Slate", "ker": "4.19", "boot_p": "isolcpus", "i": "200us", "delta": "200us", "prio": "99", "load": "hackbench", "duration": "21h22"}}
\ No newline at end of file
{"measure_type": "cyclictest_wake-up_latency", "props_names": ["wake-up latency"], "units": ["us"], "props": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 226068, 4712348, 41843151, 88650170, 88277162, 60997921, 37379247, 25081959, 17888586, 11083137, 5453618, 2109893, 665225, 176194, 42654, 10652, 3837, 1956, 1390, 1139, 1034, 902, 823, 716, 602, 504, 508, 441, 360, 359, 335, 296, 285, 253, 203, 201, 146, 121, 118, 81, 48, 46, 33, 18, 11, 10, 3, 4, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "props_type": "histogram", "metadata": {"board": "Emerald", "ker": "4.19", "boot_p": "isolcpus", "i": "200us", "delta": "200us", "prio": "99", "load": "hackbench", "duration": "21h22"}}
\ No newline at end of file
## Measurements
### Abbreviations used
* ker: Linux kernel version
* prio: Task priority
* i: Interval
* board: Board name
* boot_p: Boot Parameters
* delta: ETF qdisc delta
* load: Device and processor load
### cyclictest_wake-up_latency tables
**Common metadatas:** Linux kernel version: 4.19, Boot Parameters: isolcpus, Interval: 200us, ETF qdisc delta: 200us, Task priority: 99, Device and processor load: hackbench, duration: 21h22
Metadata | Min | Max | Avg | Var
--------- | ------------------- | ------------------- | ------------------- | -------------------
**board** | **wake-up latency** | **wake-up latency** | **wake-up latency** | **wake-up latency**
Slate | 0.0000us | 65.0000us | 21.2779us | 4.7291us
Emerald | 0.0000us | 112.0000us | 19.5352us | 4.0545us
![alt text](graphs/cyclictest_wake-up_latencywake-up latency.png "cyclictest_wake-up_latency Graph")
{"cyclictest_wake-up_latency": {"ids": [25, 26], "next_id": 28}}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment