From c69e0012f6845fcfe8d89bc980c14b7993d99cde Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Fri, 18 Feb 2011 17:55:36 -0500 Subject: tweak overhead plotting --- oplot.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/oplot.py b/oplot.py index 2f7f0cb..e0b4c69 100755 --- a/oplot.py +++ b/oplot.py @@ -24,6 +24,9 @@ options = [ o('-i', '--iqr-extent', action='store', dest='extent', type='float', help='what extent to use for outlier removal'), + o('-c', '--cut-off', action='store', dest='cutoff', type='int', + help='max number of samples to use'), + ] defaults = { @@ -35,12 +38,23 @@ defaults = { # data processing 'cycles' : 2128, # per usec 'extent' : 3, + 'cutoff' : None, # formatting options 'binsize' : 0.25, } +TXT = { + 'RELEASE-LATENCY' : 'timer latency', + 'RELEASE' : 'job release overhead', + 'SCHED' : 'scheduling overhead', + 'SCHED2' : 'post-scheduling overhead', + 'CXS' : 'context-switch overhead', + 'SEND-RESCHED' : 'IPI latency', + 'TICK' : 'timer tick overhead', +} + def get_data(fname, scale, extend): data = load_binary_file(fname) @@ -138,14 +152,22 @@ class OverheadPlotter(defapp.App): data, max_idx, min_idx, iqr_max, iqr_min = get_data(datafile, scale, self.options.extent) + + if self.options.cutoff and len(data) > self.options.cutoff: + data = data[:self.options.cutoff] + samples = data[min_idx:max_idx] discarded = (len(data) - len(samples)) / float(len(data)) * 100 max_cost = data[-1] p = self.make_plot(name) - iqr_label = "IQR: extent=%d threshold=%.2fus filtered=%.2f%%" % \ - (self.options.extent, iqr_max, discarded) + + iqr_label = "\\n".join(["samples: total=%d filtered=%d (%.2f%%)", + "IQR: extent=%d threshold=%.2fus", + ]) % \ + (len(data), len(data) - len(samples), discarded, + self.options.extent, iqr_max) p.labels = [label(0.5, 0.9, get_stats_label(samples), @@ -157,8 +179,8 @@ class OverheadPlotter(defapp.App): p.setup_histogram(gap=1, boxwidth=1.0) - p.title = "measured overheads scheduler=%s; overhead=%s; host=%s" \ - % (conf['scheduler'], conf['overhead'], conf['host']) + p.title = "%s: measured %s for %s tasks per processor (host=%s)" \ + % (conf['scheduler'], TXT[conf['overhead']], conf['n'], conf['host']) p.ylabel = "number of samples" p.xlabel = "overhead in microseconds (bin size = %.2fus)" \ -- cgit v1.2.2