diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-10-24 12:59:22 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-10-24 12:59:22 -0400 |
commit | 43f8bb33907752df05574a57ba70a6ea6f6b1f92 (patch) | |
tree | b1aff7445066c04c9ea2f8a9b124b9ad7872269b | |
parent | cad2b001d868ab2e83a3baa2d4ee55cba444fcf7 (diff) |
Added additional events.
-rwxr-xr-x | analyze | 48 | ||||
-rwxr-xr-x | split | 5 |
2 files changed, 9 insertions, 44 deletions
@@ -25,7 +25,7 @@ opts = [ | |||
25 | ] | 25 | ] |
26 | 26 | ||
27 | defaults = { | 27 | defaults = { |
28 | 'cycles' : 2128, | 28 | 'cycles' : 2400, |
29 | 'extent' : 0, | 29 | 'extent' : 0, |
30 | 'cutoff' : None, | 30 | 'cutoff' : None, |
31 | 'outlier_file' : None, | 31 | 'outlier_file' : None, |
@@ -33,7 +33,6 @@ defaults = { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | options = None | 35 | options = None |
36 | iters = None | ||
37 | 36 | ||
38 | def fmt_cell(x): | 37 | def fmt_cell(x): |
39 | if type(x) == str: | 38 | if type(x) == str: |
@@ -52,7 +51,7 @@ def write_header(): | |||
52 | print '#%s' % header[1:] | 51 | print '#%s' % header[1:] |
53 | 52 | ||
54 | 53 | ||
55 | def stats_file(fname, res): | 54 | def stats_file(fname): |
56 | name, ext = splitext(fname) | 55 | name, ext = splitext(fname) |
57 | conf = decode(name) | 56 | conf = decode(name) |
58 | 57 | ||
@@ -74,33 +73,14 @@ def stats_file(fname, res): | |||
74 | scale=scale, | 73 | scale=scale, |
75 | cutoff=options.cutoff, | 74 | cutoff=options.cutoff, |
76 | manual=take_off) | 75 | manual=take_off) |
77 | info = [conf['scheduler'], conf['overhead'], conf['n']] | 76 | info = [conf['scheduler'], conf['overhead'], 0] |
78 | res.append([x for x in info + stats]) | 77 | print ", ".join([fmt_cell(x) for x in info + stats]) |
79 | |||
80 | def merge(x, y): | ||
81 | x[3] = x[3] + y[3] # samples | ||
82 | x[4] = x[4] + y[4] # filtered | ||
83 | x[5] = x[5] + y[5] / iters # max | ||
84 | x[6] = x[6] + y[6] / iters # avg | ||
85 | x[7] = x[7] + y[7] / iters # min | ||
86 | x[8] = x[8] + y[8] / iters # med | ||
87 | # The following are kinda nonsense | ||
88 | # x[9] = x[9] + y[9] / iters # std | ||
89 | # x[10] = x[10] + y[10] / iters # var | ||
90 | # # Back to rational | ||
91 | # x[11] = x[11] + y[11] / iters # iqrmax | ||
92 | # x[12] = x[12] + y[12] / iters # iqrmin | ||
93 | return x | ||
94 | 78 | ||
95 | if __name__ == '__main__': | 79 | if __name__ == '__main__': |
96 | parser = optparse.OptionParser(option_list=opts) | 80 | parser = optparse.OptionParser(option_list=opts) |
97 | parser.set_defaults(**defaults) | 81 | parser.set_defaults(**defaults) |
98 | (options, files) = parser.parse_args() | 82 | (options, files) = parser.parse_args() |
99 | 83 | ||
100 | stats = [] | ||
101 | confs = [] | ||
102 | res = [] | ||
103 | |||
104 | try: | 84 | try: |
105 | if options.outlier_file: | 85 | if options.outlier_file: |
106 | options.outliers = load_outliers(options.outlier_file) | 86 | options.outliers = load_outliers(options.outlier_file) |
@@ -108,26 +88,8 @@ if __name__ == '__main__': | |||
108 | write_header() | 88 | write_header() |
109 | for f in files: | 89 | for f in files: |
110 | try: | 90 | try: |
111 | stats_file(f, res) | 91 | stats_file(f) |
112 | except IOError, msg: | 92 | except IOError, msg: |
113 | print >> sys.stderr, msg | 93 | print >> sys.stderr, msg |
114 | |||
115 | # Collect configurations | ||
116 | for i in res: | ||
117 | conf = [i[0], i[1], i[2]] | ||
118 | if not conf in confs: | ||
119 | # print "Adding %s to res" % (", ".join([fmt_cell(x) for x in conf])) | ||
120 | confs.append(conf) | ||
121 | |||
122 | # Reduce configurations | ||
123 | for conf in confs: | ||
124 | conf_dat = [x for x in res if x[0] == conf[0] and\ | ||
125 | x[1] == conf[1] and x[2] == conf[2]] | ||
126 | iters = len(conf_dat) | ||
127 | first = [conf[0], conf[1], conf[2],0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] | ||
128 | stats.append(reduce(merge, conf_dat, first)) | ||
129 | |||
130 | for r in stats: | ||
131 | print ", ".join([fmt_cell(x) for x in r]) | ||
132 | except KeyboardInterrupt: | 94 | except KeyboardInterrupt: |
133 | pass | 95 | pass |
@@ -2,7 +2,9 @@ | |||
2 | 2 | ||
3 | SPLITTER=ft2csv | 3 | SPLITTER=ft2csv |
4 | 4 | ||
5 | EVENTS="LVLA_RELEASE LVLA_SCHED LVLB_RELEASE LVLB_SCHED LVLC_RELEASE LVLC_SCHED" | 5 | EVENTS="LVLA_RELEASE LVLA_SCHED LVLB_RELEASE LVLB_SCHED LVLC_RELEASE LVLC_SCHED RELEASE SCHED CXS SEND_RESCHED RELEASE_LATENCY" |
6 | # EVENTS="RELEASE SCHED" | ||
7 | # EVENTS="CXS" | ||
6 | BE_EVENTS="" | 8 | BE_EVENTS="" |
7 | 9 | ||
8 | OPTS="-r" | 10 | OPTS="-r" |
@@ -22,6 +24,7 @@ function do_split() { | |||
22 | # LOCAL_OPTS="-a 0" | 24 | # LOCAL_OPTS="-a 0" |
23 | # fi | 25 | # fi |
24 | $SPLITTER $OPTS ${LOCAL_OPTS} $E "$1" >> $TARGET | 26 | $SPLITTER $OPTS ${LOCAL_OPTS} $E "$1" >> $TARGET |
27 | echo "$SPLITTER $OPTS ${LOCAL_OPTS} $E \"$1\" >> $TARGET" | ||
25 | done | 28 | done |
26 | for E in $BE_EVENTS; do | 29 | for E in $BE_EVENTS; do |
27 | echo $E | 30 | echo $E |