stats.py (1162:a45bd001ac39) stats.py (1165:234f3cdd541a)
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]

--- 29 unchanged lines hidden (view full) ---

38 set = {}
39 map(set.__setitem__, list, [])
40 return set.keys()
41
42def graphdata(runs, tag, label, value):
43 import info
44 configs = ['stx', 'ste', 'hte', 'htd', 'ocm', 'occ', 'ocp' ]
45 benchmarks = [ 'm', 's' ]
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]

--- 29 unchanged lines hidden (view full) ---

38 set = {}
39 map(set.__setitem__, list, [])
40 return set.keys()
41
42def graphdata(runs, tag, label, value):
43 import info
44 configs = ['stx', 'ste', 'hte', 'htd', 'ocm', 'occ', 'ocp' ]
45 benchmarks = [ 'm', 's' ]
46 dmas = [ 'X', 'D' ]
46 dmas = [ 'x', 'd', 'b' ]
47 caches = [ '2', '4' ]
48 checkpoints = [ '1' ]
49
50 names = []
51 for bench in benchmarks:
52 for dma in dmas:
53 for cache in caches:
54 for cpt in checkpoints:
55 names.append([bench, dma, cache, cpt])
56
57 for bench,dma,cache,cpt in names:
58 base = '%s.%s.%s.%s' % (bench, dma, cache, cpt)
47 caches = [ '2', '4' ]
48 checkpoints = [ '1' ]
49
50 names = []
51 for bench in benchmarks:
52 for dma in dmas:
53 for cache in caches:
54 for cpt in checkpoints:
55 names.append([bench, dma, cache, cpt])
56
57 for bench,dma,cache,cpt in names:
58 base = '%s.%s.%s.%s' % (bench, dma, cache, cpt)
59 fname = '/n/ziff/z/binkertn/graph/test2/data/%s.%s.dat' % (tag, base)
59 fname = 'data/%s.%s.dat' % (tag, base)
60 f = open(fname, 'w')
61 print >>f, '#set TITLE = %s' % base
62 print >>f, '#set xlbl = Configuration'
63 print >>f, '#set ylbl = %s' % label
64 print >>f, '#set sublabels = %s' % ' '.join(configs)
65
66 for speed,freq in zip(['s', 'q'],['4GHz','10GHz']):
67 print >>f, '"%s"' % freq,

--- 105 unchanged lines hidden (view full) ---

173 if len(args) != 1:
174 raise CommandException
175
176 stats = info.source.getStat(args[0])
177 for stat in stats:
178 if options.graph:
179 graphdata(runs, stat.name, stat.name, stat)
180 else:
60 f = open(fname, 'w')
61 print >>f, '#set TITLE = %s' % base
62 print >>f, '#set xlbl = Configuration'
63 print >>f, '#set ylbl = %s' % label
64 print >>f, '#set sublabels = %s' % ' '.join(configs)
65
66 for speed,freq in zip(['s', 'q'],['4GHz','10GHz']):
67 print >>f, '"%s"' % freq,

--- 105 unchanged lines hidden (view full) ---

173 if len(args) != 1:
174 raise CommandException
175
176 stats = info.source.getStat(args[0])
177 for stat in stats:
178 if options.graph:
179 graphdata(runs, stat.name, stat.name, stat)
180 else:
181 if options.binned:
182 print 'kernel ticks'
183 stat.bins = 'kernel'
184 printdata(runs, stat)
185
186 print 'idle ticks'
187 stat.bins = 'idle'
188 printdata(runs, stat)
189
190 print 'user ticks'
191 stat.bins = 'user'
192 printdata(runs, stat)
193
194 print 'interrupt ticks'
195 stat.bins = 'user'
196 printdata(runs, stat)
197
198 print 'total ticks'
199
200 stat.bins = None
181 print stat.name
182 printdata(runs, stat)
183 return
184
185 if command == 'bins':
186 if len(args) == 0:
187 info.source.listBins()
188 elif len(args) == 1:

--- 318 unchanged lines hidden ---
201 print stat.name
202 printdata(runs, stat)
203 return
204
205 if command == 'bins':
206 if len(args) == 0:
207 info.source.listBins()
208 elif len(args) == 1:

--- 318 unchanged lines hidden ---