From 3ccfe7790cb0a678f635895e20a359eb89f6f712 Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Wed, 21 Apr 2010 22:47:07 -0400 Subject: Changes made to manually tweak plots for april version of ospert10 --- plot_pm.py | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'plot_pm.py') diff --git a/plot_pm.py b/plot_pm.py index 2975b45..bc8ffff 100755 --- a/plot_pm.py +++ b/plot_pm.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import defapp +import time from os.path import splitext, basename from optparse import make_option as o from tempfile import NamedTemporaryFile as Tmp @@ -50,19 +51,32 @@ def overhead_heading(conf, sharedL3=False): ovd_type = 'unknowkn overhead' if 'ovd' in conf: if conf['ovd'] == 'preemption': - ovd_type = 'Preemption' + ovd_type = 'a preemption' elif conf['ovd'] == 'onchip': if sharedL3: - ovd_type = 'Shared L3' + ovd_type = 'a migration through a shared L3 cache' else: - ovd_type = 'Shared L2' + ovd_type = 'a migration through a shared L2 cache' elif conf['ovd'] == 'l2cache': - ovd_type = 'Shared L2' + ovd_type = 'a migration through a shared L2 cache' elif conf['ovd'] == 'offchip': - ovd_type = 'Diff. Socket' + ovd_type = 'a migration through main memory' return ovd_type +def style_selector(conf): + style = 'ls 1' + if 'ovd' in conf: + if conf['ovd'] == 'preemption': + style += '1' + elif conf['ovd'] == 'onchip': + style += '2' + elif conf['ovd'] == 'l2cache': + style += '3' + elif conf['ovd'] == 'offchip': + style += '4' + return style + class PmPlotter(defapp.App): def __init__(self): defapp.App.__init__(self, options, defaults, no_std_opts=True) @@ -91,16 +105,16 @@ class PmPlotter(defapp.App): def plot(self, graphs, title, name, conf, **xtra): name = self.compose_name(conf) print name + style = ('yerrorlines' if 'soft' in conf else 'linespoints') gnuplot(graphs, title=title, xlabel=self.options.xlabel, - ylabel=self.options.ylabel + - (' [avg]' if 'soft' in conf else ' [max]'), + ylabel=self.options.ylabel, #xrange=self.options.xrange, #yrange=self.options.yrange, #xticks=self.options.xticks, #yticks=self.options.yticks, format=self.options.format, - style=('yerrorlines' if 'soft' in conf else 'linespoints'), + style=style, fname=name, **xtra) def compose_title(self, conf): @@ -119,7 +133,9 @@ class PmPlotter(defapp.App): wsspos += 1 for i in wsslist: self.fname['wss'].add(i) - label = conf['ovd'] + ' WSS=' + i + ### XXX tweaking for ospert + #label = conf['ovd'] + ' WSS=' + i + label = overhead_heading(conf, self.options.sharedL3) if 'soft' in conf: self.graphs_list.append((tmpfile, 1, wsspos, wsspos+1, \ wsspos+2, label)) @@ -129,6 +145,10 @@ class PmPlotter(defapp.App): def plot_graph_list(self, type, name): self.plot(self.graphs_list, self.title, name, type) + ### XXX bad bad bad hack + ### for just one graph save tmp file and plot the gnuplot output for + ### manual tweaking + time.sleep(20) # delete temporary data files for tmp in self.tmpfile_list: @@ -152,6 +172,8 @@ class PmPlotter(defapp.App): % bname) # keep a list of temporary data files self.tmpfile_list.append(tmpfile) + ### XXX part of the bad ack + print tmpfile.name + ' ' + name else: self.err("Skipped '%s'; it dosn't appear to contain data." % bname) -- cgit v1.2.2