diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-09-27 19:03:22 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-09-27 19:03:22 -0400 |
commit | 7c09ec981c6e06af2e62d67a609eb53728267954 (patch) | |
tree | 76a93db7cadc452ac70eabbd52fdd87ed5fd54c4 /common.py | |
parent | 5554e053e9f3d5f7987d3f1d889802b211af8eab (diff) |
Added script to parse directory data, create CSVs for every chagned value.
This change also makes SchedTrace and OverheadTrace events configurable.
Diffstat (limited to 'common.py')
-rw-r--r-- | common.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common.py b/common.py new file mode 100644 index 0000000..a09ef7c --- /dev/null +++ b/common.py | |||
@@ -0,0 +1,17 @@ | |||
1 | from collections import defaultdict | ||
2 | |||
3 | def load_params(fname): | ||
4 | params = defaultdict(int) | ||
5 | with open(fname, 'r') as f: | ||
6 | data = f.read() | ||
7 | try: | ||
8 | parsed = eval(data) | ||
9 | # Convert to defaultdict | ||
10 | for k in parsed: | ||
11 | params[k] = str(parsed[k]) | ||
12 | except Exception as e: | ||
13 | raise IOError("Invalid param file: %s\n%s" % (fname, e)) | ||
14 | |||
15 | return params | ||
16 | |||
17 | |||