stats.py (2187:494da52c4eac) stats.py (2343:a2b4a6ccee56)
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 ----------- ------------------ ---------------------------------------
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
40 formula <formula> Evaluated formula specified
41 formulas [regex] List formulas (only matching regex)
42 runs none List all runs in database
43 samples none List samples present in database
44 stability <pairnum> <stats> Calculated statistical info about stats
45 stat <regex> Show stat data (only matching regex)
46 stats [regex] List all stats (only matching regex)
47

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

134 source.listStats()
135 elif len(args) == 1:
136 source.listStats(args[0])
137 else:
138 raise CommandException
139
140 return
141
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:
142 if command == 'formulas':
143 if len(args) == 0:
144 source.listFormulas()
145 elif len(args) == 1:
146 source.listFormulas(args[0])
147 else:
148 raise CommandException
149

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

263 stats = eval(args[0])
264
265 for stat in stats:
266 output.stat = stat
267 output.ylabel = stat.name
268 if options.graph:
269 output.graph(stat.name, options.graphdir)
270 else:
282 output.display(stat.name, options.binned, options.printmode)
271 output.display(stat.name, 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:
272
273 return
274
275 if len(args):
276 raise CommandException
277
278 from info import ProxyGroup
279 proxy = ProxyGroup(system = source[options.system])
280 system = proxy.system
281
282 etherdev = system.tsunami.etherdev0
283 bytes = etherdev.rxBytes + etherdev.txBytes
284 kbytes = bytes / 1024
285 packets = etherdev.rxPackets + etherdev.txPackets
286
287 def display():
288 if options.graph:
289 output.graph(command, options.graphdir, proxy)
290 else:
302 output.display(command, options.binned, options.printmode)
291 output.display(command, options.printmode)
303
292
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
293 if command == 'ticks':
294 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)
295
296 display()
297 return
298
299 if command == 'bytes':
300 output.stat = bytes
301 display()
302 return

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

373 if command == 'misses':
374 output.stat = misses
375 output.ylabel = 'Overall MSHR Misses'
376 display()
377 return
378
379 if command == 'mpkb':
380 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
381 output.ylabel = 'Misses / KB'
382 display()
383 return
384
385 if command == 'ipkb':
386 interrupts = system.run0.kern.faults[4]
387 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
388 output.ylabel = 'Interrupts / KB'
389 display()
390 return
391
392 if command == 'execute':
393 output.stat = system.run0.ISSUE__count
394 display()
395 return

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

416 options = Options()
417 options.host = None
418 options.db = None
419 options.passwd = ''
420 options.user = getpass.getuser()
421 options.runs = None
422 options.system = 'client'
423 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
424 options.graph = False
425 options.ticks = False
426 options.printmode = 'G'
427 jobfilename = 'Test.py'
428 options.jobfile = None
429 options.all = False
430
457 opts, args = getopts(sys.argv[1:], '-BEFJad:g:h:j:m:pr:s:u:T:')
431 opts, args = getopts(sys.argv[1:], '-EFJad:g:h:j:m:pr:s:u:T:')
458 for o,a in opts:
432 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 ---
433 if o == '-E':
434 options.printmode = 'E'
435 if o == '-F':
436 options.printmode = 'F'
437 if o == '-a':
438 options.all = True
439 if o == '-d':
440 options.db = a

--- 45 unchanged lines hidden ---