From 9bd6338e7a0707ed46d301df38851615226e0cca Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Tue, 5 May 2009 22:50:34 -0400 Subject: RTCSA submission additions --- plot.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 9 deletions(-) (limited to 'plot.py') diff --git a/plot.py b/plot.py index c0218e9..2190a6e 100755 --- a/plot.py +++ b/plot.py @@ -9,6 +9,7 @@ from gnuplot import gnuplot, FORMATS options = [ o('-f', '--format', action='store', dest='format', type='choice', choices=FORMATS, help='output format'), + o(None, '--paper', action='store_true', dest='paper'), ] defaults = { @@ -20,6 +21,7 @@ defaults = { 'title' : None, 'xlabel' : 'task set utilization cap (prior to inflation)', 'ylabel' : 'ratio of schedulable task sets', + 'paper' : False, } def decode(name): @@ -54,15 +56,15 @@ def scenario_heading(conf): dist = 'unknown distribution' if 'dist' in conf: if conf['dist'] == 'uni': - dist = 'uniformly distributed' + dist = 'uniformly distributed ' if 'light' in conf: - dist = dist + ' in [0.001, 0.1]' + dist = dist + 'in [0.001, 0.1]' elif 'medium' in conf: - dist = dist + ' in [0.1, 0.4]' + dist = dist + 'in [0.1, 0.4]' elif 'heavy' in conf: - dist = dist + ' in [0.5, 0.9]' + dist = dist + 'in [0.5, 0.9]' elif conf['dist'] == 'bimo': - dist = 'bimodially distributed' + dist = 'bimodially distributed ' if 'light' in conf: dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)' elif 'medium' in conf: @@ -75,7 +77,7 @@ class SchedPlotter(defapp.App): def __init__(self): defapp.App.__init__(self, options, defaults, no_std_opts=True) - def plot(self, graphs, title, name, conf): + def plot(self, graphs, title, name, conf, **xtra): gnuplot(graphs, title=title, xlabel=self.options.xlabel, ylabel=self.options.ylabel + @@ -85,10 +87,26 @@ class SchedPlotter(defapp.App): xticks=self.options.xticks, yticks=self.options.yticks, format=self.options.format, - fname=name) + fname=name, **xtra) + + def plot_paper(self, graphs, title, name, conf, **xtra): + tops = 'color solid font "Helvetica,12" linewidth 1.0 rounded size 16cm,8.5cm' + gnuplot(graphs, title=title, + xlabel=self.options.xlabel, + ylabel=self.options.ylabel + + (' [soft]' if 'soft' in conf else ' [hard]'), + xrange=self.options.xrange, + yrange=self.options.yrange, + xticks=self.options.xticks, + yticks=self.options.yticks, + format=self.options.format, + fname=name, + key='off', + style='lines lw 7', + term_opts=tops) def plot_spec(self, tmpfile, name, conf): - title = 'release overhead speculation: ' + scenario_heading(conf) + title = 'G-EDF overhead speculation: ' + scenario_heading(conf) graphs = [ (tmpfile, 1, 2, 'G-EDF (100% release)'), (tmpfile, 1, 3, 'G-EDF ( 75% release)'), @@ -97,7 +115,10 @@ class SchedPlotter(defapp.App): (tmpfile, 1, 6, 'G-EDF ( 0% release)'), (tmpfile, 1, 7, 'G-EDF (no overheads)'), ] - self.plot(graphs, title, name, conf) + if self.options.paper and self.options.format == 'pdf': + self.plot_paper(graphs, title, name, conf) + else: + self.plot(graphs, title, name, conf) def plot_spec2(self, tmpfile, name, conf): title = 'service processor speculation: ' + scenario_heading(conf) @@ -109,6 +130,43 @@ class SchedPlotter(defapp.App): ] self.plot(graphs, title, name, conf) + def plot_spec3(self, tmpfile, name, conf): + title = 'linear overhead charge speculation: ' + scenario_heading(conf) + graphs = [ + (tmpfile, 1, 2, 'G-EDF (100% release)'), + (tmpfile, 1, 3, 'G-EDF ( 25% release)'), + (tmpfile, 1, 4, 'G-EDF ( Lin release)'), + ] + self.plot(graphs, title, name, conf) + + def plot_spec4(self, tmpfile, name, conf): + title = 'linear overhead charge speculation: ' + scenario_heading(conf) + graphs = [ + (tmpfile, 1, 2, 'G-EDF (100% release)'), + (tmpfile, 1, 3, 'G-EDF-S (100% release, all cpus)'), + (tmpfile, 1, 4, 'G-EDF-S (100% release, one cpu)'), + (tmpfile, 1, 5, 'G-EDF (25% release)'), + (tmpfile, 1, 6, 'G-EDF-S (25% release, all cpus)'), + (tmpfile, 1, 7, 'G-EDF-S (25% release, one cpu)'), + ] + self.plot(graphs, title, name, conf) + + def plot_irq(self, tmpfile, name, conf): + graphs = [ + (tmpfile, 1, 2, 'quantum-centric (100% overhead)'), + (tmpfile, 1, 3, 'task-centric (100% overhead)'), + (tmpfile, 1, 4, 'processor-centric (100% overhead)'), + (tmpfile, 1, 5, 'quantum-centric (20% overhead)'), + (tmpfile, 1, 6, 'task-centric (20% overhead)'), + (tmpfile, 1, 7, 'processor-centric (20% overhead)'), + ] + if self.options.paper and self.options.format == 'pdf': + title = scenario_heading(conf) + self.plot_paper(graphs, title, name, conf) + else: + title = 'Interrupt accounting under G-EDF: utilization ' + scenario_heading(conf) + self.plot(graphs, title, name, conf) + def plot_file(self, datafile): bname = basename(datafile) name, ext = splitext(bname) @@ -122,6 +180,12 @@ class SchedPlotter(defapp.App): self.plot_spec(tmpfile.name, name, conf) elif 'spec2' in conf: self.plot_spec2(tmpfile.name, name, conf) + elif 'spec3' in conf: + self.plot_spec3(tmpfile.name, name, conf) + elif 'spec4' in conf: + self.plot_spec4(tmpfile.name, name, conf) + elif 'irq' in conf: + self.plot_irq(tmpfile.name, name, conf) else: self.err("Skipped '%s'; unkown experiment type." % bname) -- cgit v1.2.2