diff options
author | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-06-09 15:16:41 -0400 |
---|---|---|
committer | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-06-09 15:16:41 -0400 |
commit | 05da44afb031ceefc3e6e97d3c34b5b3a05472a8 (patch) | |
tree | 950b0114c62d4a6e7d5100430f5a8b041fb30381 | |
parent | 26778e546b294372f84433a5657334b1975e8ae6 (diff) |
add --experiment option for override
-rwxr-xr-x | plot.py | 46 |
1 files changed, 27 insertions, 19 deletions
@@ -15,6 +15,9 @@ options = [ | |||
15 | choices=FORMATS, help='output format'), | 15 | choices=FORMATS, help='output format'), |
16 | o(None, '--save-script', action='store_true', dest='save_script'), | 16 | o(None, '--save-script', action='store_true', dest='save_script'), |
17 | 17 | ||
18 | o('-e', '--experiment', action='store', dest='experiment', | ||
19 | help="override auto-detection of experiment"), | ||
20 | |||
18 | # formatting options | 21 | # formatting options |
19 | # These may or may not be supported by a particular experiment plotter. | 22 | # These may or may not be supported by a particular experiment plotter. |
20 | o(None, '--paper', action='store_true', dest='paper'), | 23 | o(None, '--paper', action='store_true', dest='paper'), |
@@ -27,6 +30,7 @@ options = [ | |||
27 | defaults = { | 30 | defaults = { |
28 | # output options | 31 | # output options |
29 | 'format' : 'show', | 32 | 'format' : 'show', |
33 | 'experiment' : None, | ||
30 | 'save_script' : False, | 34 | 'save_script' : False, |
31 | 35 | ||
32 | # formatting options | 36 | # formatting options |
@@ -490,25 +494,29 @@ class SchedPlotter(defapp.App): | |||
490 | except IOError: | 494 | except IOError: |
491 | tmpfile = None | 495 | tmpfile = None |
492 | if tmpfile: | 496 | if tmpfile: |
493 | if 'spec' in conf: | 497 | plotters = { |
494 | self.plot_spec(tmpfile.name, name, conf) | 498 | 'spec' : self.plot_spec, |
495 | elif 'spec2' in conf: | 499 | 'spec2' : self.plot_spec2, |
496 | self.plot_spec2(tmpfile.name, name, conf) | 500 | 'spec3' : self.plot_spec3, |
497 | elif 'spec3' in conf: | 501 | 'spec4' : self.plot_spec4, |
498 | self.plot_spec3(tmpfile.name, name, conf) | 502 | 'irq' : self.plot_irq, |
499 | elif 'spec4' in conf: | 503 | 'rtss08' : self.plot_rtss08, |
500 | self.plot_spec4(tmpfile.name, name, conf) | 504 | 'rtss09' : self.plot_rtss09_split if self.options.split else self.plot_rtss09, |
501 | elif 'irq' in conf: | 505 | 'ospert10' : self.plot_ospert10, |
502 | self.plot_irq(tmpfile.name, name, conf) | 506 | } |
503 | elif 'rtss08' in conf: | 507 | |
504 | self.plot_rtss08(tmpfile.name, name, conf) | 508 | if self.options.experiment: |
505 | elif 'rtss09' in conf: | 509 | # override provided |
506 | if self.options.split: | 510 | plot_type = self.options.experiment |
507 | self.plot_rtss09_split(tmpfile.name, name, conf) | 511 | else: |
508 | else: | 512 | # no type provided, try each plotter |
509 | self.plot_rtss09(tmpfile.name, name, conf) | 513 | for plot_type in plotters: |
510 | elif 'ospert10' in conf: | 514 | if plot_type in conf: |
511 | self.plot_ospert10(tmpfile.name, name, conf) | 515 | break |
516 | if not plot_type in conf: | ||
517 | plot_type = 'unknown' | ||
518 | if plot_type in plotters: | ||
519 | plotters[plot_type](tmpfile.name, name, conf) | ||
512 | else: | 520 | else: |
513 | self.err("Skipped '%s'; unkown experiment type." | 521 | self.err("Skipped '%s'; unkown experiment type." |
514 | % bname) | 522 | % bname) |