Deleted Added
sdiff udiff text old ( 2187:494da52c4eac ) new ( 2343:a2b4a6ccee56 )
full compact
1#!/usr/bin/env python
2
3# Copyright (c) 2003-2004 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

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

32def usage():
33 print '''\
34Usage: %s [-E] [-F] [ -G <get> ] [-d <db> ] [-g <graphdir> ] [-h <host>] [-p]
35 [-s <system>] [-r <runs> ] [-T <samples>] [-u <username>]
36 <command> [command args]
37
38 commands extra parameters description
39 ----------- ------------------ ---------------------------------------
40 bins [regex] List bins (only matching regex)
41 formula <formula> Evaluated formula specified
42 formulas [regex] List formulas (only matching regex)
43 runs none List all runs in database
44 samples none List samples present in database
45 stability <pairnum> <stats> Calculated statistical info about stats
46 stat <regex> Show stat data (only matching regex)
47 stats [regex] List all stats (only matching regex)
48

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

135 source.listStats()
136 elif len(args) == 1:
137 source.listStats(args[0])
138 else:
139 raise CommandException
140
141 return
142
143 if command == 'bins':
144 if len(args) == 0:
145 source.listBins()
146 elif len(args) == 1:
147 source.listBins(args[0])
148 else:
149 raise CommandException
150
151 return
152
153 if command == 'formulas':
154 if len(args) == 0:
155 source.listFormulas()
156 elif len(args) == 1:
157 source.listFormulas(args[0])
158 else:
159 raise CommandException
160

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

274 stats = eval(args[0])
275
276 for stat in stats:
277 output.stat = stat
278 output.ylabel = stat.name
279 if options.graph:
280 output.graph(stat.name, options.graphdir)
281 else:
282 output.display(stat.name, options.binned, options.printmode)
283
284 return
285
286 if len(args):
287 raise CommandException
288
289 from info import ProxyGroup
290 proxy = ProxyGroup(system = source[options.system])
291 system = proxy.system
292
293 etherdev = system.tsunami.etherdev0
294 bytes = etherdev.rxBytes + etherdev.txBytes
295 kbytes = bytes / 1024
296 packets = etherdev.rxPackets + etherdev.txPackets
297
298 def display():
299 if options.graph:
300 output.graph(command, options.graphdir, proxy)
301 else:
302 output.display(command, options.binned, options.printmode)
303
304 if command == 'usertime':
305 import copy
306 user = copy.copy(system.run0.numCycles)
307 user.bins = 'user'
308
309 output.stat = user / system.run0.numCycles
310 output.ylabel = 'User Fraction'
311
312 display()
313 return
314
315 if command == 'ticks':
316 output.stat = system.run0.numCycles
317 output.binstats = [ system.run0.numCycles ]
318
319 display()
320 return
321
322 if command == 'bytes':
323 output.stat = bytes
324 display()
325 return

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

396 if command == 'misses':
397 output.stat = misses
398 output.ylabel = 'Overall MSHR Misses'
399 display()
400 return
401
402 if command == 'mpkb':
403 output.stat = misses / (bytes / 1024)
404 output.binstats = [ misses ]
405 output.ylabel = 'Misses / KB'
406 display()
407 return
408
409 if command == 'ipkb':
410 interrupts = system.run0.kern.faults[4]
411 output.stat = interrupts / kbytes
412 output.binstats = [ interrupts ]
413 output.ylabel = 'Interrupts / KB'
414 display()
415 return
416
417 if command == 'execute':
418 output.stat = system.run0.ISSUE__count
419 display()
420 return

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

441 options = Options()
442 options.host = None
443 options.db = None
444 options.passwd = ''
445 options.user = getpass.getuser()
446 options.runs = None
447 options.system = 'client'
448 options.method = None
449 options.binned = False
450 options.graph = False
451 options.ticks = False
452 options.printmode = 'G'
453 jobfilename = 'Test.py'
454 options.jobfile = None
455 options.all = False
456
457 opts, args = getopts(sys.argv[1:], '-BEFJad:g:h:j:m:pr:s:u:T:')
458 for o,a in opts:
459 if o == '-B':
460 options.binned = True
461 if o == '-E':
462 options.printmode = 'E'
463 if o == '-F':
464 options.printmode = 'F'
465 if o == '-a':
466 options.all = True
467 if o == '-d':
468 options.db = a

--- 45 unchanged lines hidden ---