aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Ward <bcw@cs.unc.edu>2013-04-18 16:12:06 -0400
committerBryan Ward <bcw@cs.unc.edu>2013-04-18 16:12:06 -0400
commite1eed1bc02642210a53618147cd55c180bc716ca (patch)
treea9ee92fc5354da0e620571feb639ebf58298dc27
parentb8f3c7a1ccd2fffc54f15e808505a568ce5fa492 (diff)
Updated config and parsing.
-rw-r--r--config/config.py4
-rw-r--r--parse/ft.py11
2 files changed, 9 insertions, 6 deletions
diff --git a/config/config.py b/config/config.py
index cbac6b2..eed3648 100644
--- a/config/config.py
+++ b/config/config.py
@@ -3,7 +3,7 @@ import itertools
3from common import get_executable_hint,ft_freq 3from common import get_executable_hint,ft_freq
4 4
5'''Paths to binaries.''' 5'''Paths to binaries.'''
6BINS = {'rtspin' : get_executable_hint('rtspin', 'liblitmus'), 6BINS = {'rtspin' : get_executable_hint('rtspin', 'liblitmus', True),
7 'release' : get_executable_hint('release_ts', 'liblitmus'), 7 'release' : get_executable_hint('release_ts', 'liblitmus'),
8 'ftcat' : get_executable_hint('ftcat', 'feather-trace-tools'), 8 'ftcat' : get_executable_hint('ftcat', 'feather-trace-tools'),
9 'ftsplit' : get_executable_hint('ft2csv', 'feather-trace-tools'), 9 'ftsplit' : get_executable_hint('ft2csv', 'feather-trace-tools'),
@@ -45,7 +45,7 @@ DEFAULTS = {'params_file' : 'params.py',
45SCHED_EVENTS = range(501, 513) 45SCHED_EVENTS = range(501, 513)
46 46
47'''Overhead events.''' 47'''Overhead events.'''
48OVH_BASE_EVENTS = ['SCHED', 'RELEASE', 'SCHED2', 'TICK', 'CXS'] 48OVH_BASE_EVENTS = ['SCHED', 'RELEASE', 'SCHED2', 'TICK', 'CXS', 'LOCK', 'UNLOCK']
49OVH_ALL_EVENTS = ["%s_%s" % (e, t) for (e,t) in 49OVH_ALL_EVENTS = ["%s_%s" % (e, t) for (e,t) in
50 itertools.product(OVH_BASE_EVENTS, ["START","END"])] 50 itertools.product(OVH_BASE_EVENTS, ["START","END"])]
51OVH_ALL_EVENTS += ['RELEASE_LATENCY'] 51OVH_ALL_EVENTS += ['RELEASE_LATENCY']
diff --git a/parse/ft.py b/parse/ft.py
index 1f05323..1e0947f 100644
--- a/parse/ft.py
+++ b/parse/ft.py
@@ -20,6 +20,7 @@ def parse_overhead(result, overhead_bin, overhead, cycles, out_dir, err_file):
20 os.remove(ovh_fname) 20 os.remove(ovh_fname)
21 ovh_file = open(ovh_fname, 'w') 21 ovh_file = open(ovh_fname, 'w')
22 22
23 err_file.write("Overhead is %s" % overhead)
23 # Extract matching overhead events into a seperate file 24 # Extract matching overhead events into a seperate file
24 cmd = [conf.BINS["ftsplit"], "-r", "-b", overhead, overhead_bin] 25 cmd = [conf.BINS["ftsplit"], "-r", "-b", overhead, overhead_bin]
25 ret = subprocess.call(cmd, cwd=out_dir, stderr=err_file, stdout=ovh_file) 26 ret = subprocess.call(cmd, cwd=out_dir, stderr=err_file, stdout=ovh_file)
@@ -27,13 +28,14 @@ def parse_overhead(result, overhead_bin, overhead, cycles, out_dir, err_file):
27 28
28 if ret: 29 if ret:
29 raise Exception("Failed (%d) with command: %s" % (ret, " ".join(cmd))) 30 raise Exception("Failed (%d) with command: %s" % (ret, " ".join(cmd)))
30 if not size: 31 #if not size:
31 os.remove(ovh_fname) 32 # os.remove(ovh_fname)
32 if size and not ret: 33 if size and not ret:
33 # Map and sort file for stats 34 # Map and sort file for stats
34 data = np.memmap(ovh_fname, dtype="float32", mode='c') 35 data = np.memmap(ovh_fname, dtype="float32", mode='c')
35 data /= float(cycles) # Scale for processor speed 36 data /= float(cycles) # Scale for processor speed
36 data.sort() 37 data.sort()
38 print("Have %s of %s" % (len(data), overhead))
37 39
38 m = Measurement("%s-%s" % (overhead_bin, overhead)) 40 m = Measurement("%s-%s" % (overhead_bin, overhead))
39 m[Type.Max] = data[-1] 41 m[Type.Max] = data[-1]
@@ -43,7 +45,7 @@ def parse_overhead(result, overhead_bin, overhead, cycles, out_dir, err_file):
43 45
44 result[overhead] = m 46 result[overhead] = m
45 47
46 os.remove(ovh_fname) 48 #os.remove(ovh_fname)
47 49
48def sort_ft(ft_file, err_file, out_dir): 50def sort_ft(ft_file, err_file, out_dir):
49 '''Create and return file with sorted overheads from @ft_file.''' 51 '''Create and return file with sorted overheads from @ft_file.'''
@@ -77,9 +79,10 @@ def extract_ft_data(result, data_dir, work_dir, cycles):
77 sorted_bin = sort_ft(bin_file, err_file, work_dir) 79 sorted_bin = sort_ft(bin_file, err_file, work_dir)
78 80
79 for event in conf.OVH_BASE_EVENTS: 81 for event in conf.OVH_BASE_EVENTS:
82 print event
80 parse_overhead(result, sorted_bin, event, cycles, 83 parse_overhead(result, sorted_bin, event, cycles,
81 work_dir, err_file) 84 work_dir, err_file)
82 85
83 os.remove(sorted_bin) 86 #os.remove(sorted_bin)
84 87
85 return True 88 return True