diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-18 17:55:36 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-18 17:55:36 -0500 |
commit | c69e0012f6845fcfe8d89bc980c14b7993d99cde (patch) | |
tree | c001ea8da0884783758917a208f53a4ba422354c /oplot.py | |
parent | 6f06d564aaf93c89406cd3ff52bae03432cce2ae (diff) |
tweak overhead plotting
Diffstat (limited to 'oplot.py')
-rwxr-xr-x | oplot.py | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -24,6 +24,9 @@ options = [ | |||
24 | o('-i', '--iqr-extent', action='store', dest='extent', type='float', | 24 | o('-i', '--iqr-extent', action='store', dest='extent', type='float', |
25 | help='what extent to use for outlier removal'), | 25 | help='what extent to use for outlier removal'), |
26 | 26 | ||
27 | o('-c', '--cut-off', action='store', dest='cutoff', type='int', | ||
28 | help='max number of samples to use'), | ||
29 | |||
27 | ] | 30 | ] |
28 | 31 | ||
29 | defaults = { | 32 | defaults = { |
@@ -35,12 +38,23 @@ defaults = { | |||
35 | # data processing | 38 | # data processing |
36 | 'cycles' : 2128, # per usec | 39 | 'cycles' : 2128, # per usec |
37 | 'extent' : 3, | 40 | 'extent' : 3, |
41 | 'cutoff' : None, | ||
38 | 42 | ||
39 | # formatting options | 43 | # formatting options |
40 | 'binsize' : 0.25, | 44 | 'binsize' : 0.25, |
41 | } | 45 | } |
42 | 46 | ||
43 | 47 | ||
48 | TXT = { | ||
49 | 'RELEASE-LATENCY' : 'timer latency', | ||
50 | 'RELEASE' : 'job release overhead', | ||
51 | 'SCHED' : 'scheduling overhead', | ||
52 | 'SCHED2' : 'post-scheduling overhead', | ||
53 | 'CXS' : 'context-switch overhead', | ||
54 | 'SEND-RESCHED' : 'IPI latency', | ||
55 | 'TICK' : 'timer tick overhead', | ||
56 | } | ||
57 | |||
44 | def get_data(fname, scale, extend): | 58 | def get_data(fname, scale, extend): |
45 | data = load_binary_file(fname) | 59 | data = load_binary_file(fname) |
46 | 60 | ||
@@ -138,14 +152,22 @@ class OverheadPlotter(defapp.App): | |||
138 | data, max_idx, min_idx, iqr_max, iqr_min = get_data(datafile, | 152 | data, max_idx, min_idx, iqr_max, iqr_min = get_data(datafile, |
139 | scale, | 153 | scale, |
140 | self.options.extent) | 154 | self.options.extent) |
155 | |||
156 | if self.options.cutoff and len(data) > self.options.cutoff: | ||
157 | data = data[:self.options.cutoff] | ||
158 | |||
141 | samples = data[min_idx:max_idx] | 159 | samples = data[min_idx:max_idx] |
142 | discarded = (len(data) - len(samples)) / float(len(data)) * 100 | 160 | discarded = (len(data) - len(samples)) / float(len(data)) * 100 |
143 | max_cost = data[-1] | 161 | max_cost = data[-1] |
144 | 162 | ||
145 | p = self.make_plot(name) | 163 | p = self.make_plot(name) |
146 | 164 | ||
147 | iqr_label = "IQR: extent=%d threshold=%.2fus filtered=%.2f%%" % \ | 165 | |
148 | (self.options.extent, iqr_max, discarded) | 166 | iqr_label = "\\n".join(["samples: total=%d filtered=%d (%.2f%%)", |
167 | "IQR: extent=%d threshold=%.2fus", | ||
168 | ]) % \ | ||
169 | (len(data), len(data) - len(samples), discarded, | ||
170 | self.options.extent, iqr_max) | ||
149 | 171 | ||
150 | p.labels = [label(0.5, 0.9, | 172 | p.labels = [label(0.5, 0.9, |
151 | get_stats_label(samples), | 173 | get_stats_label(samples), |
@@ -157,8 +179,8 @@ class OverheadPlotter(defapp.App): | |||
157 | 179 | ||
158 | p.setup_histogram(gap=1, boxwidth=1.0) | 180 | p.setup_histogram(gap=1, boxwidth=1.0) |
159 | 181 | ||
160 | p.title = "measured overheads scheduler=%s; overhead=%s; host=%s" \ | 182 | p.title = "%s: measured %s for %s tasks per processor (host=%s)" \ |
161 | % (conf['scheduler'], conf['overhead'], conf['host']) | 183 | % (conf['scheduler'], TXT[conf['overhead']], conf['n'], conf['host']) |
162 | 184 | ||
163 | p.ylabel = "number of samples" | 185 | p.ylabel = "number of samples" |
164 | p.xlabel = "overhead in microseconds (bin size = %.2fus)" \ | 186 | p.xlabel = "overhead in microseconds (bin size = %.2fus)" \ |