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 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 |
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: |
271 output.display(stat.name, options.printmode) |
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: |
291 output.display(command, options.printmode) |
292 |
293 if command == 'ticks': 294 output.stat = system.run0.numCycles |
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) |
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 |
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 |
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 |
431 opts, args = getopts(sys.argv[1:], '-EFJad:g:h:j:m:pr:s:u:T:') |
432 for o,a in opts: |
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 --- |