stats.py (1301:f85f6fb43474) | stats.py (1307:e6b9976895c6) |
---|---|
1#!/usr/bin/env python 2from __future__ import division 3import re, sys 4 5def usage(): 6 print '''\ 7Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p] 8 [-s <system>] [-r <runs> ] [-u <username>] <command> [command args] --- 25 unchanged lines hidden (view full) --- 34 35printval.mode = 'G' 36 37def unique(list): 38 set = {} 39 map(set.__setitem__, list, []) 40 return set.keys() 41 | 1#!/usr/bin/env python 2from __future__ import division 3import re, sys 4 5def usage(): 6 print '''\ 7Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p] 8 [-s <system>] [-r <runs> ] [-u <username>] <command> [command args] --- 25 unchanged lines hidden (view full) --- 34 35printval.mode = 'G' 36 37def unique(list): 38 set = {} 39 map(set.__setitem__, list, []) 40 return set.keys() 41 |
42def graphdata68(runs, options, tag, label, value): 43 import info 44 configs = ['ste', 'hte', 'htd', 'ocm', 'occ', 'ocp' ] 45 benchmarks = [ 'm', 's', 'snt', 'nb1', 'w1', 'w2', 'w3', 'w4', 'nm', 'ns', 'nw1', 'nw2', 'nw3' ] 46 dmas = [ 'x' ] 47 caches = [ '2', '4' ] 48 49 names = [] 50 51 bench_system = { 52 'm' : 'client', 53 's' : 'client', 54 'snt' : 'client', 55 'nb1' : 'server', 56 'nb2' : 'server', 57 'nt1' : 'server', 58 'nt2' : 'server', 59 'w1' : 'server', 60 'w2' : 'server', 61 'w3' : 'server', 62 'w4' : 'server', 63 'w1s' : 'server', 64 'w2s' : 'server', 65 'w3s' : 'server', 66 'ns' : 'natbox', 67 'nm' : 'natbox', 68 'nw1' : 'natbox', 69 'nw2' : 'natbox', 70 'nw3' : 'natbox' 71 } 72 73 for bench in benchmarks: 74 if bench_system[bench] != options.system: 75 continue 76 77 for dma in dmas: 78 for cache in caches: 79 names.append([bench, dma, cache]) 80 81 for bench,dma,cache in names: 82 base = '%s.%s.%s' % (bench, dma, cache) 83 fname = 'data/%s.%s.68.dat' % (tag, base) 84 f = open(fname, 'w') 85 print >>f, '#set TITLE = ' 86 print >>f, '#set ylbl = %s' % label 87 #print >>f, '#set sublabels = %s' % ' '.join(configs) 88 print >>f, '#set sublabels = ste hte htd ocm occ ocs' 89 90 for speed,freq in zip(['s', '6', '8', 'q'],['4GHz', '6GHz','8GHz', '10GHz']): 91 print >>f, '"%s"' % freq, 92 for conf in configs: 93 name = '%s.%s.%s.%s.%s' % (conf, bench, dma, cache, speed) 94 run = info.source.allRunNames[name] 95 info.display_run = run.run; 96 val = float(value) 97 if val == 1e300*1e300: 98 print >>f, 0.0, 99 else: 100 print >>f, "%f" % val, 101 print >>f 102 f.close() 103 |
|
42def graphdata(runs, options, tag, label, value): | 104def graphdata(runs, options, tag, label, value): |
105 if options.graph68: 106 graphdata68(runs, options, tag, label, value) 107 return 108 |
|
43 import info 44 configs = ['ste', 'hte', 'htd', 'ocm', 'occ', 'ocp' ] 45 #benchmarks = [ 'm', 's', 'nb1', 'nb2', 'nt1', 'nt2', 'w1', 'w2', 'w3', 'w4', 'ns', 'nm', 'nw1', 'nw2', 'nw3' ] 46 #benchmarks = [ 'm', 's', 'nb1', 'nb2', 'nt1', 'w1', 'w2', 'w3', 'ns', 'nm', 'w1s' ] 47 benchmarks = [ 'm', 's', 'nb1', 'nb2', 'w1', 'w2', 'w3', 'w4', 'ns', 'nm', 'nw1', 'snt' ] 48 #dmas = [ 'x', 'd', 'b' ] 49 dmas = [ 'x' ] 50 caches = [ '2', '4' ] --- 29 unchanged lines hidden (view full) --- 80 for dma in dmas: 81 for cache in caches: 82 names.append([bench, dma, cache]) 83 84 for bench,dma,cache in names: 85 base = '%s.%s.%s' % (bench, dma, cache) 86 fname = 'data/%s.%s.dat' % (tag, base) 87 f = open(fname, 'w') | 109 import info 110 configs = ['ste', 'hte', 'htd', 'ocm', 'occ', 'ocp' ] 111 #benchmarks = [ 'm', 's', 'nb1', 'nb2', 'nt1', 'nt2', 'w1', 'w2', 'w3', 'w4', 'ns', 'nm', 'nw1', 'nw2', 'nw3' ] 112 #benchmarks = [ 'm', 's', 'nb1', 'nb2', 'nt1', 'w1', 'w2', 'w3', 'ns', 'nm', 'w1s' ] 113 benchmarks = [ 'm', 's', 'nb1', 'nb2', 'w1', 'w2', 'w3', 'w4', 'ns', 'nm', 'nw1', 'snt' ] 114 #dmas = [ 'x', 'd', 'b' ] 115 dmas = [ 'x' ] 116 caches = [ '2', '4' ] --- 29 unchanged lines hidden (view full) --- 146 for dma in dmas: 147 for cache in caches: 148 names.append([bench, dma, cache]) 149 150 for bench,dma,cache in names: 151 base = '%s.%s.%s' % (bench, dma, cache) 152 fname = 'data/%s.%s.dat' % (tag, base) 153 f = open(fname, 'w') |
88 print >>f, '#set TITLE = %s' % base 89 print >>f, '#set xlbl = Configuration' | 154 print >>f, '#set TITLE = ' |
90 print >>f, '#set ylbl = %s' % label | 155 print >>f, '#set ylbl = %s' % label |
91 print >>f, '#set sublabels = %s' % ' '.join(configs) | 156 #print >>f, '#set sublabels = %s' % ' '.join(configs) 157 print >>f, '#set sublabels = ste hte htd ocm occ ocs' |
92 93 for speed,freq in zip(['s', 'q'],['4GHz','10GHz']): 94 print >>f, '"%s"' % freq, 95 for conf in configs: 96 name = '%s.%s.%s.%s.%s' % (conf, bench, dma, cache, speed) 97 run = info.source.allRunNames[name] 98 info.display_run = run.run; 99 val = float(value) --- 97 unchanged lines hidden (view full) --- 197 if len(args) != 1: 198 raise CommandException 199 200 stats = info.source.getStat(args[0]) 201 for stat in stats: 202 if options.graph: 203 graphdata(runs, options, stat.name, stat.name, stat) 204 else: | 158 159 for speed,freq in zip(['s', 'q'],['4GHz','10GHz']): 160 print >>f, '"%s"' % freq, 161 for conf in configs: 162 name = '%s.%s.%s.%s.%s' % (conf, bench, dma, cache, speed) 163 run = info.source.allRunNames[name] 164 info.display_run = run.run; 165 val = float(value) --- 97 unchanged lines hidden (view full) --- 263 if len(args) != 1: 264 raise CommandException 265 266 stats = info.source.getStat(args[0]) 267 for stat in stats: 268 if options.graph: 269 graphdata(runs, options, stat.name, stat.name, stat) 270 else: |
205 if options.ticks: 206 print 'only displaying sample %s' % options.ticks 207 stat.ticks = options.ticks 208 | |
209 if options.binned: 210 print 'kernel ticks' 211 stat.bins = 'kernel' 212 printdata(runs, stat) 213 214 print 'idle ticks' 215 stat.bins = 'idle' 216 printdata(runs, stat) 217 218 print 'user ticks' 219 stat.bins = 'user' 220 printdata(runs, stat) 221 222 print 'interrupt ticks' | 271 if options.binned: 272 print 'kernel ticks' 273 stat.bins = 'kernel' 274 printdata(runs, stat) 275 276 print 'idle ticks' 277 stat.bins = 'idle' 278 printdata(runs, stat) 279 280 print 'user ticks' 281 stat.bins = 'user' 282 printdata(runs, stat) 283 284 print 'interrupt ticks' |
223 stat.bins = 'interrupt' | 285 stat.bins = 'user' |
224 printdata(runs, stat) 225 226 print 'total ticks' 227 228 stat.bins = None 229 print stat.name 230 printdata(runs, stat) 231 return --- 16 unchanged lines hidden (view full) --- 248 stat.bins = 'idle' 249 printdata(runs, stat) 250 251 print 'user ticks' 252 stat.bins = 'user' 253 printdata(runs, stat) 254 255 print 'interrupt ticks' | 286 printdata(runs, stat) 287 288 print 'total ticks' 289 290 stat.bins = None 291 print stat.name 292 printdata(runs, stat) 293 return --- 16 unchanged lines hidden (view full) --- 310 stat.bins = 'idle' 311 printdata(runs, stat) 312 313 print 'user ticks' 314 stat.bins = 'user' 315 printdata(runs, stat) 316 317 print 'interrupt ticks' |
256 stat.bins = 'interrupt' | 318 stat.bins = 'user' |
257 printdata(runs, stat) 258 259 print 'total ticks' 260 261 stat.bins = None 262 print args[0] 263 printdata(runs, stat) 264 return --- 312 unchanged lines hidden (view full) --- 577 options.db = None 578 options.passwd = '' 579 options.user = getpass.getuser() 580 options.runs = None 581 options.system = 'client' 582 options.get = None 583 options.binned = False 584 options.graph = False | 319 printdata(runs, stat) 320 321 print 'total ticks' 322 323 stat.bins = None 324 print args[0] 325 printdata(runs, stat) 326 return --- 312 unchanged lines hidden (view full) --- 639 options.db = None 640 options.passwd = '' 641 options.user = getpass.getuser() 642 options.runs = None 643 options.system = 'client' 644 options.get = None 645 options.binned = False 646 options.graph = False |
585 options.ticks = False | 647 options.graph68 = False |
586 | 648 |
587 opts, args = getopts(sys.argv[1:], '-BEFGd:g:h:pr:s:u:T:') | 649 opts, args = getopts(sys.argv[1:], '-6BEFGd:g:h:pr:s:u:') |
588 for o,a in opts: | 650 for o,a in opts: |
651 if o == '-6': 652 options.graph68 = True |
|
589 if o == '-B': 590 options.binned = True 591 if o == '-E': 592 printval.mode = 'E' 593 if o == '-F': 594 printval.mode = 'F' 595 if o == '-G': 596 options.graph = True; --- 6 unchanged lines hidden (view full) --- 603 if o == '-p': 604 options.passwd = getpass.getpass() 605 if o == '-r': 606 options.runs = a 607 if o == '-u': 608 options.user = a 609 if o == '-s': 610 options.system = a | 653 if o == '-B': 654 options.binned = True 655 if o == '-E': 656 printval.mode = 'E' 657 if o == '-F': 658 printval.mode = 'F' 659 if o == '-G': 660 options.graph = True; --- 6 unchanged lines hidden (view full) --- 667 if o == '-p': 668 options.passwd = getpass.getpass() 669 if o == '-r': 670 options.runs = a 671 if o == '-u': 672 options.user = a 673 if o == '-s': 674 options.system = a |
611 if o == '-T': 612 options.ticks = a | |
613 614 if len(args) == 0: 615 usage() 616 617 command = args[0] 618 args = args[1:] 619 620 try: 621 commands(options, command, args) 622 except CommandException: 623 usage() | 675 676 if len(args) == 0: 677 usage() 678 679 command = args[0] 680 args = args[1:] 681 682 try: 683 commands(options, command, args) 684 except CommandException: 685 usage() |