diff options
Diffstat (limited to 'plot_pm2.py')
| -rwxr-xr-x | plot_pm2.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plot_pm2.py b/plot_pm2.py index 1332825..09b2d49 100755 --- a/plot_pm2.py +++ b/plot_pm2.py | |||
| @@ -103,6 +103,7 @@ options = [ | |||
| 103 | o(None, '--paper', action='store_true', dest='paper'), | 103 | o(None, '--paper', action='store_true', dest='paper'), |
| 104 | o(None, '--wide', action='store_true', dest='wide'), | 104 | o(None, '--wide', action='store_true', dest='wide'), |
| 105 | o(None, '--split', action='store_true', dest='split'), | 105 | o(None, '--split', action='store_true', dest='split'), |
| 106 | o(None, '--log-y', action='store_true', dest='logy'), | ||
| 106 | o(None, '--extend', action='store', type='float', dest='extend'), | 107 | o(None, '--extend', action='store', type='float', dest='extend'), |
| 107 | o(None, '--aggregate', action='store_true', dest='aggregate'), | 108 | o(None, '--aggregate', action='store_true', dest='aggregate'), |
| 108 | o('-c', '--cycles-per-usec', action='store', type='float', dest='cycles_per_usec'), | 109 | o('-c', '--cycles-per-usec', action='store', type='float', dest='cycles_per_usec'), |
| @@ -116,6 +117,7 @@ defaults = { | |||
| 116 | 'aggregate' : False, | 117 | 'aggregate' : False, |
| 117 | 'extend' : 1.5, | 118 | 'extend' : 1.5, |
| 118 | 'cycles_per_usec' : None, | 119 | 'cycles_per_usec' : None, |
| 120 | 'logy' : False, | ||
| 119 | } | 121 | } |
| 120 | 122 | ||
| 121 | def extract_cols(data, xcol, ycol1, ycol2, cast=int, cpu_filter=lambda x, y: True): | 123 | def extract_cols(data, xcol, ycol1, ycol2, cast=int, cpu_filter=lambda x, y: True): |
| @@ -363,6 +365,11 @@ class CyclePlotter(defapp.App): | |||
| 363 | rw = int(conf['wcycle']) | 365 | rw = int(conf['wcycle']) |
| 364 | rw = 1.0 / rw * 100 if rw != 0 else 0 | 366 | rw = 1.0 / rw * 100 if rw != 0 else 0 |
| 365 | 367 | ||
| 368 | if self.options.logy: | ||
| 369 | axis = ("x 2", "y 10") | ||
| 370 | else: | ||
| 371 | axis = "x 2" | ||
| 372 | |||
| 366 | # raw measures | 373 | # raw measures |
| 367 | for offset, kind, long in [(0, 'avg', 'average'), (2, 'wc', 'maximum')]: | 374 | for offset, kind, long in [(0, 'avg', 'average'), (2, 'wc', 'maximum')]: |
| 368 | graphs = [] | 375 | graphs = [] |
| @@ -380,8 +387,9 @@ class CyclePlotter(defapp.App): | |||
| 380 | yrange = None #(4096, 2**26) | 387 | yrange = None #(4096, 2**26) |
| 381 | 388 | ||
| 382 | fname = "%s_full_%s" % (name, kind) | 389 | fname = "%s_full_%s" % (name, kind) |
| 390 | |||
| 383 | gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, | 391 | gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, |
| 384 | yrange=yrange, logscale=("x 2", "y 10"), format=self.options.format) | 392 | yrange=yrange, logscale=axis, format=self.options.format) |
| 385 | 393 | ||
| 386 | # per-sample delta measures | 394 | # per-sample delta measures |
| 387 | for offset, kind, long in [(0, 'avg', 'average'), (2, 'wc', 'maximum')]: | 395 | for offset, kind, long in [(0, 'avg', 'average'), (2, 'wc', 'maximum')]: |
| @@ -399,7 +407,7 @@ class CyclePlotter(defapp.App): | |||
| 399 | 407 | ||
| 400 | fname = "%s_delta_%s" % (name, kind) | 408 | fname = "%s_delta_%s" % (name, kind) |
| 401 | gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, | 409 | gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, |
| 402 | yrange=yrange, logscale=("x 2", "y 10"), format=self.options.format) | 410 | yrange=yrange, logscale=axis, format=self.options.format) |
| 403 | del tmp | 411 | del tmp |
| 404 | 412 | ||
| 405 | # stats delta | 413 | # stats delta |
| @@ -435,7 +443,7 @@ class CyclePlotter(defapp.App): | |||
| 435 | 443 | ||
| 436 | fname = "%s_diff_%s" % (name, kind) | 444 | fname = "%s_diff_%s" % (name, kind) |
| 437 | gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, | 445 | gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, |
| 438 | yrange=yrange, logscale=("x 2", "y 10"), format=self.options.format) | 446 | yrange=yrange, logscale=axis, format=self.options.format) |
| 439 | del tmp | 447 | del tmp |
| 440 | 448 | ||
| 441 | def plot_file(self, datafile): | 449 | def plot_file(self, datafile): |
