diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-09-29 17:38:06 -0400 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-09-29 17:38:06 -0400 |
| commit | c6adbabd0bf897a1e750fe07bf068e285dd82108 (patch) | |
| tree | 440b94beaa285f8c21dc1d9407e9c676a99c1a95 /parse | |
| parent | 2844e3887b4ff635dfa85e9b2ec773b06fe9af4f (diff) | |
Bug fixes for mixed-criticality task systems.
Diffstat (limited to 'parse')
| -rw-r--r-- | parse/ft.py | 2 | ||||
| -rw-r--r-- | parse/point.py | 2 | ||||
| -rw-r--r-- | parse/sched.py | 10 |
3 files changed, 6 insertions, 8 deletions
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): | |||
| 49 | 49 | ||
| 50 | for ovh in overheads: | 50 | for ovh in overheads: |
| 51 | measure = Measurement("%s-%s" % (data_file, ovh)) | 51 | measure = Measurement("%s-%s" % (data_file, ovh)) |
| 52 | vals = re.findall(".*{}".format(ovh) + rstr, data); | 52 | vals = re.findall(r"\s+{}".format(ovh.replace('_','-')) + rstr, data); |
| 53 | if len(vals) != 0: | 53 | if len(vals) != 0: |
| 54 | vals = vals[0] | 54 | vals = vals[0] |
| 55 | measure[Type.Max] = float(vals[0]) | 55 | 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(): | |||
| 16 | return copy.deepcopy(default_typemap) | 16 | return copy.deepcopy(default_typemap) |
| 17 | 17 | ||
| 18 | def dict_str(adict, sep = "\n"): | 18 | def dict_str(adict, sep = "\n"): |
| 19 | return sep.join(["%s: %s" % (k, str(v)) for (k,v) in adict.iteritems()]) | 19 | return sep.join(["%s: %s" % (k, str(v)) for (k,v) in sorted(adict.iteritems())]) |
| 20 | 20 | ||
| 21 | class Measurement(object): | 21 | class Measurement(object): |
| 22 | def __init__(self, id = None, kv = {}): | 22 | 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): | |||
| 56 | max_tards = [] | 56 | max_tards = [] |
| 57 | 57 | ||
| 58 | for t in get_tasks(data): | 58 | for t in get_tasks(data): |
| 59 | reg = r"TARDY.*?" + t.pid + "/(\d+).*?Tot.*?([\d\.]+).*?ms.*([\d\.]+).*?ms.*?([\d\.]+)" | 59 | reg = r"TARDY.*?" + t.pid + "/(\d+).*?Tot.*?([\d\.]+).*?ms.*?([\d\.]+).*?ms.*?([\d\.]+)" |
| 60 | matches = re.findall(reg, data) | 60 | matches = re.findall(reg, data) |
| 61 | if len(matches) != 0: | 61 | if len(matches) != 0: |
| 62 | jobs = float(matches[0][0]) | 62 | jobs = float(matches[0][0]) |
| 63 | 63 | ||
| 64 | total_tard = float(matches[0][1]) | 64 | total_tard = float(matches[0][1]) |
| 65 | print("total tard: %s" % total_tard) | ||
| 66 | avg_tard = (total_tard / jobs) / float(t.config.period) | 65 | avg_tard = (total_tard / jobs) / float(t.config.period) |
| 67 | max_tard = float(matches[0][2]) / float(t.config.period) | 66 | max_tard = float(matches[0][2]) / float(t.config.period) |
| 68 | 67 | ||
| 69 | print("avg tard: %s" % avg_tard) | ||
| 70 | |||
| 71 | misses = float(matches[0][3]) | 68 | misses = float(matches[0][3]) |
| 72 | if misses != 0: | 69 | if misses != 0: |
| 73 | miss_ratio = (misses / jobs) | 70 | miss_ratio = (misses / jobs) |
| 74 | print("misses is %d, jobs is %d" % (misses, jobs)) | ||
| 75 | else: | 71 | else: |
| 76 | miss_ratio = 0 | 72 | miss_ratio = 0 |
| 77 | 73 | ||
| @@ -118,6 +114,7 @@ def config_exit_stats(file): | |||
| 118 | 114 | ||
| 119 | # Dictionary of task exit measurements by pid | 115 | # Dictionary of task exit measurements by pid |
| 120 | exits = get_task_exits(data) | 116 | exits = get_task_exits(data) |
| 117 | |||
| 121 | exit_dict = dict((e.id, e) for e in exits) | 118 | exit_dict = dict((e.id, e) for e in exits) |
| 122 | 119 | ||
| 123 | # Dictionary where keys are configurations, values are list | 120 | # Dictionary where keys are configurations, values are list |
| @@ -131,7 +128,7 @@ def config_exit_stats(file): | |||
| 131 | 128 | ||
| 132 | # Replace tasks with corresponding exit stats | 129 | # Replace tasks with corresponding exit stats |
| 133 | exit_list = [exit_dict[t.pid] for t in task_list] | 130 | exit_list = [exit_dict[t.pid] for t in task_list] |
| 134 | config_dict[config] = exit_list | 131 | config_dict[config] = exit_list |
| 135 | 132 | ||
| 136 | return config_dict | 133 | return config_dict |
| 137 | 134 | ||
| @@ -153,6 +150,7 @@ def extract_scaling_data(data_file, base_file, result): | |||
| 153 | # each group | 150 | # each group |
| 154 | max_scales = [] | 151 | max_scales = [] |
| 155 | avg_scales = [] | 152 | avg_scales = [] |
| 153 | |||
| 156 | for config in data_stats: | 154 | for config in data_stats: |
| 157 | if len(data_stats[config]) != len(base_stats[config]): | 155 | if len(data_stats[config]) != len(base_stats[config]): |
| 158 | # Quit, we are missing a record and can't guarantee | 156 | # Quit, we are missing a record and can't guarantee |
