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