Deleted Added
sdiff udiff text old ( 2005:5d2963051cc7 ) new ( 2006:3ca085495c69 )
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

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

254 for command in all:
255 commands(options, command, args)
256
257 if options.ticks:
258 if not options.graph:
259 print 'only displaying sample %s' % options.ticks
260 source.ticks = [ int(x) for x in options.ticks.split() ]
261
262 from output import StatOutput
263 output = StatOutput(options.jobfile, source)
264 output.xlabel = 'System Configuration'
265
266 if command == 'stat' or command == 'formula':
267 if len(args) != 1:
268 raise CommandException
269
270 if command == 'stat':
271 stats = source.getStat(args[0])
272 if command == 'formula':
273 stats = eval(args[0])
274
275 for stat in stats:
276 output.stat = stat
277 output.ylabel = stat.name
278 if options.graph:
279 output.graph(stat.name, options.graphdir)
280 else:
281 output.display(stat.name, options.binned, options.printmode)
282
283 return
284
285 if len(args):
286 raise CommandException
287
288 from info import ProxyGroup
289 sim_seconds = source['sim_seconds']
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 bps = etherdev.rxBandwidth + etherdev.txBandwidth
298
299 def display():
300 if options.graph:
301 output.graph(command, options.graphdir, proxy)
302 else:
303 output.display(command, options.binned, options.printmode)
304
305 if command == 'usertime':
306 import copy
307 user = copy.copy(system.run0.numCycles)
308 user.bins = 'user'
309
310 output.stat = user / system.run0.numCycles
311 output.ylabel = 'User Fraction'
312
313 display()
314 return
315
316 if command == 'ticks':
317 output.stat = system.run0.numCycles
318 output.binstats = [ system.run0.numCycles ]
319

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

333 if command == 'ppt' or command == 'tpp':
334 output.stat = packets / system.run0.numCycles
335 output.invert = command == 'tpp'
336 display()
337 return
338
339 if command == 'pps':
340 output.stat = packets / sim_seconds
341 output.ylabel = 'Packets/s'
342 display()
343 return
344
345 if command == 'bpt' or command == 'tpb':
346 output.stat = bytes / system.run0.numCycles * 8
347 output.ylabel = 'bps / Hz'
348 output.invert = command == 'tpb'
349 display()
350 return
351
352 if command in ('rxbps', 'txbps', 'bps'):
353 if command == 'rxbps':
354 output.stat = etherdev.rxBandwidth / 1e9
355 if command == 'txbps':
356 output.stat = etherdev.txBandwidth / 1e9
357 if command == 'bps':
358 output.stat = bps / 1e9
359
360 output.ylabel = 'Bandwidth (Gbps)'
361 output.ylim = [ 0.0, 10.0 ]
362 display()
363 return
364
365 if command == 'bpp':
366 output.stat = bytes / packets
367 output.ylabel = 'Bytes / Packet'
368 display()
369 return
370
371 if command == 'rxbpp':
372 output.stat = etherdev.rxBytes / etherdev.rxPackets
373 output.ylabel = 'Receive Bytes / Packet'
374 display()
375 return
376
377 if command == 'txbpp':
378 output.stat = etherdev.txBytes / etherdev.txPackets
379 output.ylabel = 'Transmit Bytes / Packet'
380 display()
381 return
382
383 if command == 'rtp':
384 output.stat = etherdev.rxPackets / etherdev.txPackets
385 output.ylabel = 'rxPackets / txPackets'
386 display()
387 return
388
389 if command == 'rtb':
390 output.stat = etherdev.rxBytes / etherdev.txBytes
391 output.ylabel = 'rxBytes / txBytes'
392 display()
393 return
394
395 misses = system.l2.overall_mshr_misses
396
397 if command == 'misses':
398 output.stat = misses
399 output.ylabel = 'Overall MSHR Misses'
400 display()
401 return
402
403 if command == 'mpkb':
404 output.stat = misses / (bytes / 1024)
405 output.binstats = [ misses ]
406 output.ylabel = 'Misses / KB'
407 display()
408 return
409
410 if command == 'ipkb':
411 interrupts = system.run0.kern.faults[4]
412 output.stat = interrupts / kbytes
413 output.binstats = [ interrupts ]
414 output.ylabel = 'Interrupts / KB'
415 display()
416 return
417
418 if command == 'execute':
419 output.stat = system.run0.ISSUE__count
420 display()
421 return
422

--- 92 unchanged lines hidden ---