stats.py (2005:5d2963051cc7) stats.py (2006:3ca085495c69)
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
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 import output
262 from output import StatOutput
263 output = StatOutput(options.jobfile, source)
264 output.xlabel = 'System Configuration'
263
265
264 def display():
265 if options.graph:
266 output.graph(options.graphdir)
267 else:
268 output.display(options.binned, options.printmode)
269
270
271 if command == 'stat' or command == 'formula':
272 if len(args) != 1:
273 raise CommandException
274
275 if command == 'stat':
276 stats = source.getStat(args[0])
277 if command == 'formula':
278 stats = eval(args[0])
279
280 for stat in stats:
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:
281 output = output.StatOutput(stat.name, options.jobfile, source)
282 output.stat = stat
276 output.stat = stat
283 output.label = stat.name
284 display()
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)
285
286 return
287
288 if len(args):
289 raise CommandException
290
282
283 return
284
285 if len(args):
286 raise CommandException
287
291 system = source.__dict__[options.system]
292 from info import ProxyGroup
293 sim_seconds = source['sim_seconds']
294 proxy = ProxyGroup(system = source[options.system])
295 system = proxy.system
296
297 etherdev = system.tsunami.etherdev0
298 bytes = etherdev.rxBytes + etherdev.txBytes
299 kbytes = bytes / 1024
300 packets = etherdev.rxPackets + etherdev.txPackets
301 bps = etherdev.rxBandwidth + etherdev.txBandwidth
302
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
303 output = output.StatOutput(command, options.jobfile, source)
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
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.label = 'User Fraction'
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
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.label = 'Packets/s'
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
342 display()
343 return
344
345 if command == 'bpt' or command == 'tpb':
346 output.stat = bytes / system.run0.numCycles * 8
347 output.label = 'bps / Hz'
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
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.label = 'Bandwidth (Gbps)'
360 output.ylabel = 'Bandwidth (Gbps)'
361 output.ylim = [ 0.0, 10.0 ]
361 display()
362 return
363
364 if command == 'bpp':
365 output.stat = bytes / packets
362 display()
363 return
364
365 if command == 'bpp':
366 output.stat = bytes / packets
366 output.label = 'Bytes / Packet'
367 output.ylabel = 'Bytes / Packet'
367 display()
368 return
369
370 if command == 'rxbpp':
371 output.stat = etherdev.rxBytes / etherdev.rxPackets
368 display()
369 return
370
371 if command == 'rxbpp':
372 output.stat = etherdev.rxBytes / etherdev.rxPackets
372 output.label = 'Receive Bytes / Packet'
373 output.ylabel = 'Receive Bytes / Packet'
373 display()
374 return
375
376 if command == 'txbpp':
377 output.stat = etherdev.txBytes / etherdev.txPackets
374 display()
375 return
376
377 if command == 'txbpp':
378 output.stat = etherdev.txBytes / etherdev.txPackets
378 output.label = 'Transmit Bytes / Packet'
379 output.ylabel = 'Transmit Bytes / Packet'
379 display()
380 return
381
382 if command == 'rtp':
383 output.stat = etherdev.rxPackets / etherdev.txPackets
380 display()
381 return
382
383 if command == 'rtp':
384 output.stat = etherdev.rxPackets / etherdev.txPackets
384 output.label = 'rxPackets / txPackets'
385 output.ylabel = 'rxPackets / txPackets'
385 display()
386 return
387
388 if command == 'rtb':
389 output.stat = etherdev.rxBytes / etherdev.txBytes
386 display()
387 return
388
389 if command == 'rtb':
390 output.stat = etherdev.rxBytes / etherdev.txBytes
390 output.label = 'rxBytes / txBytes'
391 output.ylabel = 'rxBytes / txBytes'
391 display()
392 return
393
394 misses = system.l2.overall_mshr_misses
395
396 if command == 'misses':
397 output.stat = misses
392 display()
393 return
394
395 misses = system.l2.overall_mshr_misses
396
397 if command == 'misses':
398 output.stat = misses
398 output.label = 'Overall MSHR Misses'
399 output.ylabel = 'Overall MSHR Misses'
399 display()
400 return
401
402 if command == 'mpkb':
403 output.stat = misses / (bytes / 1024)
404 output.binstats = [ misses ]
400 display()
401 return
402
403 if command == 'mpkb':
404 output.stat = misses / (bytes / 1024)
405 output.binstats = [ misses ]
405 output.label = 'Misses / KB'
406 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
412 output.binstats = [ interrupts ]
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 ]
413 output.label = 'Interrupts / KB'
414 output.ylabel = 'Interrupts / KB'
414 display()
415 return
416
417 if command == 'execute':
418 output.stat = system.run0.ISSUE__count
419 display()
420 return
421

--- 92 unchanged lines hidden ---
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 ---