stats.py (2665:a124942bacb8) stats.py (2716:b9114064d77a)
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

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

34def usage():
35 print '''\
36Usage: %s [-E] [-F] [ -G <get> ] [-d <db> ] [-g <graphdir> ] [-h <host>] [-p]
37 [-s <system>] [-r <runs> ] [-T <samples>] [-u <username>]
38 <command> [command args]
39
40 commands extra parameters description
41 ----------- ------------------ ---------------------------------------
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

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

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

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

137 source.listStats()
138 elif len(args) == 1:
139 source.listStats(args[0])
140 else:
141 raise CommandException
142
143 return
144
42 formula <formula> Evaluated formula specified
43 formulas [regex] List formulas (only matching regex)
44 runs none List all runs in database
45 samples none List samples present in database
46 stability <pairnum> <stats> Calculated statistical info about stats
47 stat <regex> Show stat data (only matching regex)
48 stats [regex] List all stats (only matching regex)
49

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

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

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

276 stats = eval(args[0])
277
278 for stat in stats:
279 output.stat = stat
280 output.ylabel = stat.name
281 if options.graph:
282 output.graph(stat.name, options.graphdir)
283 else:
144 if command == 'formulas':
145 if len(args) == 0:
146 source.listFormulas()
147 elif len(args) == 1:
148 source.listFormulas(args[0])
149 else:
150 raise CommandException
151

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

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

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

398 if command == 'misses':
399 output.stat = misses
400 output.ylabel = 'Overall MSHR Misses'
401 display()
402 return
403
404 if command == 'mpkb':
405 output.stat = misses / (bytes / 1024)
297
298 display()
299 return
300
301 if command == 'bytes':
302 output.stat = bytes
303 display()
304 return

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

375 if command == 'misses':
376 output.stat = misses
377 output.ylabel = 'Overall MSHR Misses'
378 display()
379 return
380
381 if command == 'mpkb':
382 output.stat = misses / (bytes / 1024)
406 output.binstats = [ misses ]
407 output.ylabel = 'Misses / KB'
408 display()
409 return
410
411 if command == 'ipkb':
412 interrupts = system.run0.kern.faults[4]
413 output.stat = interrupts / kbytes
383 output.ylabel = 'Misses / KB'
384 display()
385 return
386
387 if command == 'ipkb':
388 interrupts = system.run0.kern.faults[4]
389 output.stat = interrupts / kbytes
414 output.binstats = [ interrupts ]
415 output.ylabel = 'Interrupts / KB'
416 display()
417 return
418
419 if command == 'execute':
420 output.stat = system.run0.ISSUE__count
421 display()
422 return

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

443 options = Options()
444 options.host = None
445 options.db = None
446 options.passwd = ''
447 options.user = getpass.getuser()
448 options.runs = None
449 options.system = 'client'
450 options.method = None
390 output.ylabel = 'Interrupts / KB'
391 display()
392 return
393
394 if command == 'execute':
395 output.stat = system.run0.ISSUE__count
396 display()
397 return

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

418 options = Options()
419 options.host = None
420 options.db = None
421 options.passwd = ''
422 options.user = getpass.getuser()
423 options.runs = None
424 options.system = 'client'
425 options.method = None
451 options.binned = False
452 options.graph = False
453 options.ticks = False
454 options.printmode = 'G'
455 jobfilename = 'Test.py'
456 options.jobfile = None
457 options.all = False
458
426 options.graph = False
427 options.ticks = False
428 options.printmode = 'G'
429 jobfilename = 'Test.py'
430 options.jobfile = None
431 options.all = False
432
459 opts, args = getopts(sys.argv[1:], '-BEFJad:g:h:j:m:pr:s:u:T:')
433 opts, args = getopts(sys.argv[1:], '-EFJad:g:h:j:m:pr:s:u:T:')
460 for o,a in opts:
434 for o,a in opts:
461 if o == '-B':
462 options.binned = True
463 if o == '-E':
464 options.printmode = 'E'
465 if o == '-F':
466 options.printmode = 'F'
467 if o == '-a':
468 options.all = True
469 if o == '-d':
470 options.db = a

--- 45 unchanged lines hidden ---
435 if o == '-E':
436 options.printmode = 'E'
437 if o == '-F':
438 options.printmode = 'F'
439 if o == '-a':
440 options.all = True
441 if o == '-d':
442 options.db = a

--- 45 unchanged lines hidden ---