From c6adbabd0bf897a1e750fe07bf068e285dd82108 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Sat, 29 Sep 2012 17:38:06 -0400 Subject: Bug fixes for mixed-criticality task systems. --- parse/ft.py | 2 +- parse/point.py | 2 +- parse/sched.py | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'parse') diff --git a/parse/ft.py b/parse/ft.py index 868c8ca..20a430e 100644 --- a/parse/ft.py +++ b/parse/ft.py @@ -49,7 +49,7 @@ def extract_ft_data(data_file, result, overheads): for ovh in overheads: measure = Measurement("%s-%s" % (data_file, ovh)) - vals = re.findall(".*{}".format(ovh) + rstr, data); + vals = re.findall(r"\s+{}".format(ovh.replace('_','-')) + rstr, data); if len(vals) != 0: vals = vals[0] measure[Type.Max] = float(vals[0]) diff --git a/parse/point.py b/parse/point.py index 4343d03..30fcd97 100644 --- a/parse/point.py +++ b/parse/point.py @@ -16,7 +16,7 @@ def make_typemap(): return copy.deepcopy(default_typemap) def dict_str(adict, sep = "\n"): - return sep.join(["%s: %s" % (k, str(v)) for (k,v) in adict.iteritems()]) + return sep.join(["%s: %s" % (k, str(v)) for (k,v) in sorted(adict.iteritems())]) class Measurement(object): def __init__(self, id = None, kv = {}): diff --git a/parse/sched.py b/parse/sched.py index 94ab000..5e3ba6b 100644 --- a/parse/sched.py +++ b/parse/sched.py @@ -56,22 +56,18 @@ def extract_tardy_vals(data, exp_point): max_tards = [] for t in get_tasks(data): - reg = r"TARDY.*?" + t.pid + "/(\d+).*?Tot.*?([\d\.]+).*?ms.*([\d\.]+).*?ms.*?([\d\.]+)" + reg = r"TARDY.*?" + t.pid + "/(\d+).*?Tot.*?([\d\.]+).*?ms.*?([\d\.]+).*?ms.*?([\d\.]+)" matches = re.findall(reg, data) if len(matches) != 0: jobs = float(matches[0][0]) total_tard = float(matches[0][1]) - print("total tard: %s" % total_tard) avg_tard = (total_tard / jobs) / float(t.config.period) max_tard = float(matches[0][2]) / float(t.config.period) - print("avg tard: %s" % avg_tard) - misses = float(matches[0][3]) if misses != 0: miss_ratio = (misses / jobs) - print("misses is %d, jobs is %d" % (misses, jobs)) else: miss_ratio = 0 @@ -118,6 +114,7 @@ def config_exit_stats(file): # Dictionary of task exit measurements by pid exits = get_task_exits(data) + exit_dict = dict((e.id, e) for e in exits) # Dictionary where keys are configurations, values are list @@ -131,7 +128,7 @@ def config_exit_stats(file): # Replace tasks with corresponding exit stats exit_list = [exit_dict[t.pid] for t in task_list] - config_dict[config] = exit_list + config_dict[config] = exit_list return config_dict @@ -153,6 +150,7 @@ def extract_scaling_data(data_file, base_file, result): # each group max_scales = [] avg_scales = [] + for config in data_stats: if len(data_stats[config]) != len(base_stats[config]): # Quit, we are missing a record and can't guarantee -- cgit v1.2.2