stats.py (1596:d11171f51a63) stats.py (1604:c986abdfc71f)
1#!/usr/bin/env python
2from __future__ import division
3import re, sys, math
4
5
6def usage():
7 print '''\
8Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p]

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

98 base = '%s.%s.%s' % (bench, dma, cache)
99 fname = 'data/%s.%s.68.dat' % (tag, base)
100 f = open(fname, 'w')
101 print >>f, '#set TITLE = '
102 print >>f, '#set ylbl = %s' % label
103 #print >>f, '#set sublabels = %s' % ' '.join(configs)
104 print >>f, '#set sublabels = ste hte htd ocm occ ocs'
105
1#!/usr/bin/env python
2from __future__ import division
3import re, sys, math
4
5
6def usage():
7 print '''\
8Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p]

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

98 base = '%s.%s.%s' % (bench, dma, cache)
99 fname = 'data/%s.%s.68.dat' % (tag, base)
100 f = open(fname, 'w')
101 print >>f, '#set TITLE = '
102 print >>f, '#set ylbl = %s' % label
103 #print >>f, '#set sublabels = %s' % ' '.join(configs)
104 print >>f, '#set sublabels = ste hte htd ocm occ ocs'
105
106 for speed,freq in zip(['s', '6', '8', 'q'],['4GHz', '6GHz','8GHz', '10GHz']):
106 for speed,freq in zip(['s', 'm', 'f', 'q'],['4GHz', '6GHz','8GHz', '10GHz']):
107 print >>f, '"%s"' % freq,
108 for conf in configs:
109 name = '%s.%s.%s.%s.%s' % (conf, bench, dma, cache, speed)
110 run = info.source.allRunNames[name]
111 info.display_run = run.run;
112 val = float(value)
113 if val == 1e300*1e300:
114 print >>f, 0.0,

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

454
455 if len(args):
456 raise CommandException
457
458 system = info.source.__dict__[options.system]
459
460 if command == 'usertime':
461 import copy
107 print >>f, '"%s"' % freq,
108 for conf in configs:
109 name = '%s.%s.%s.%s.%s' % (conf, bench, dma, cache, speed)
110 run = info.source.allRunNames[name]
111 info.display_run = run.run;
112 val = float(value)
113 if val == 1e300*1e300:
114 print >>f, 0.0,

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

454
455 if len(args):
456 raise CommandException
457
458 system = info.source.__dict__[options.system]
459
460 if command == 'usertime':
461 import copy
462 kernel = copy.copy(system.full_cpu.numCycles)
462 kernel = copy.copy(system.full0.numCycles)
463 kernel.bins = 'kernel'
464
463 kernel.bins = 'kernel'
464
465 user = copy.copy(system.full_cpu.numCycles)
465 user = copy.copy(system.full0.numCycles)
466 user.bins = 'user'
467
468 if options.graph:
469 graphdata(runs, options, 'usertime', 'User Fraction',
466 user.bins = 'user'
467
468 if options.graph:
469 graphdata(runs, options, 'usertime', 'User Fraction',
470 user / system.full_cpu.numCycles)
470 user / system.full0.numCycles)
471 else:
471 else:
472 printdata(runs, user / system.full_cpu.numCycles)
472 printdata(runs, user / system.full0.numCycles)
473 return
474
475 if command == 'ticks':
476 if options.binned:
477 print 'kernel ticks'
473 return
474
475 if command == 'ticks':
476 if options.binned:
477 print 'kernel ticks'
478 system.full_cpu.numCycles.bins = 'kernel'
479 printdata(runs, system.full_cpu.numCycles)
478 system.full0.numCycles.bins = 'kernel'
479 printdata(runs, system.full0.numCycles)
480
481 print 'idle ticks'
480
481 print 'idle ticks'
482 system.full_cpu.numCycles.bins = 'idle'
483 printdata(runs, system.full_cpu.numCycles)
482 system.full0.numCycles.bins = 'idle'
483 printdata(runs, system.full0.numCycles)
484
485 print 'user ticks'
484
485 print 'user ticks'
486 system.full_cpu.numCycles.bins = 'user'
487 printdata(runs, system.full_cpu.numCycles)
486 system.full0.numCycles.bins = 'user'
487 printdata(runs, system.full0.numCycles)
488
489 print 'total ticks'
490
488
489 print 'total ticks'
490
491 system.full_cpu.numCycles.bins = None
492 printdata(runs, system.full_cpu.numCycles)
491 system.full0.numCycles.bins = None
492 printdata(runs, system.full0.numCycles)
493 return
494
495 if command == 'packets':
493 return
494
495 if command == 'packets':
496 packets = system.tsunami.etherdev.rxPackets
496 packets = system.tsunami.etherdev0.rxPackets
497 if options.graph:
498 graphdata(runs, options, 'packets', 'Packets', packets)
499 else:
500 printdata(runs, packets)
501 return
502
503 if command == 'ppt' or command == 'tpp':
497 if options.graph:
498 graphdata(runs, options, 'packets', 'Packets', packets)
499 else:
500 printdata(runs, packets)
501 return
502
503 if command == 'ppt' or command == 'tpp':
504 ppt = system.tsunami.etherdev.rxPackets / sim_ticks
504 ppt = system.tsunami.etherdev0.rxPackets / sim_ticks
505 printdata(runs, ppt, command == 'tpp')
506 return
507
508 if command == 'pps':
505 printdata(runs, ppt, command == 'tpp')
506 return
507
508 if command == 'pps':
509 pps = system.tsunami.etherdev.rxPackets / sim_seconds
509 pps = system.tsunami.etherdev0.rxPackets / sim_seconds
510 if options.graph:
511 graphdata(runs, options, 'pps', 'Packets/s', pps)
512 else:
513 printdata(runs, pps)
514 return
515
516 if command == 'bpt' or command == 'tpb':
510 if options.graph:
511 graphdata(runs, options, 'pps', 'Packets/s', pps)
512 else:
513 printdata(runs, pps)
514 return
515
516 if command == 'bpt' or command == 'tpb':
517 bytes = system.tsunami.etherdev.rxBytes + system.tsunami.etherdev.txBytes
517 bytes = system.tsunami.etherdev0.rxBytes + system.tsunami.etherdev0.txBytes
518 bpt = bytes / sim_ticks * 8
519 if options.graph:
520 graphdata(runs, options, 'bpt', 'bps / Hz', bpt)
521 else:
522 printdata(runs, bpt, command == 'tpb')
523 return
524
525 if command == 'bptb' or command == 'tpbb':
518 bpt = bytes / sim_ticks * 8
519 if options.graph:
520 graphdata(runs, options, 'bpt', 'bps / Hz', bpt)
521 else:
522 printdata(runs, bpt, command == 'tpb')
523 return
524
525 if command == 'bptb' or command == 'tpbb':
526 bytes = system.tsunami.etherdev.rxBytes + system.tsunami.etherdev.txBytes
526 bytes = system.tsunami.etherdev0.rxBytes + system.tsunami.etherdev0.txBytes
527
528 print 'kernel stats'
529 bytes.bins = 'kernel'
530 printdata(runs, bytes / ticks)
531
532 print 'idle stats'
533 bytes.bins = 'idle'
534 printdata(runs, bytes / ticks)
535
536 print 'user stats'
537 bytes.bins = 'user'
538 printdata(runs, bytes / ticks)
539
540 return
541
542 if command == 'bytes':
527
528 print 'kernel stats'
529 bytes.bins = 'kernel'
530 printdata(runs, bytes / ticks)
531
532 print 'idle stats'
533 bytes.bins = 'idle'
534 printdata(runs, bytes / ticks)
535
536 print 'user stats'
537 bytes.bins = 'user'
538 printdata(runs, bytes / ticks)
539
540 return
541
542 if command == 'bytes':
543 stat = system.tsunami.etherdev.rxBytes + system.tsunami.etherdev.txBytes
543 stat = system.tsunami.etherdev0.rxBytes + system.tsunami.etherdev0.txBytes
544
545 if options.binned:
546 print '%s kernel stats' % stat.name
547 stat.bins = 'kernel'
548 printdata(runs, stat)
549
550 print '%s idle stats' % stat.name
551 stat.bins = 'idle'

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

557
558 print '%s total stats' % stat.name
559 stat.bins = None
560
561 printdata(runs, stat)
562 return
563
564 if command == 'rxbps':
544
545 if options.binned:
546 print '%s kernel stats' % stat.name
547 stat.bins = 'kernel'
548 printdata(runs, stat)
549
550 print '%s idle stats' % stat.name
551 stat.bins = 'idle'

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

557
558 print '%s total stats' % stat.name
559 stat.bins = None
560
561 printdata(runs, stat)
562 return
563
564 if command == 'rxbps':
565 gbps = system.tsunami.etherdev.rxBandwidth / 1e9
565 gbps = system.tsunami.etherdev0.rxBandwidth / 1e9
566 if options.graph:
567 graphdata(runs, options, 'rxbps', 'Bandwidth (Gbps)', gbps)
568 else:
569 printdata(runs, gbps)
570 return
571
572 if command == 'txbps':
566 if options.graph:
567 graphdata(runs, options, 'rxbps', 'Bandwidth (Gbps)', gbps)
568 else:
569 printdata(runs, gbps)
570 return
571
572 if command == 'txbps':
573 gbps = system.tsunami.etherdev.txBandwidth / 1e9
573 gbps = system.tsunami.etherdev0.txBandwidth / 1e9
574 if options.graph:
575 graphdata(runs, options, 'txbps', 'Bandwidth (Gbps)', gbps)
576 else:
577 printdata(runs, gbps)
578 return
579
580 if command == 'bps':
574 if options.graph:
575 graphdata(runs, options, 'txbps', 'Bandwidth (Gbps)', gbps)
576 else:
577 printdata(runs, gbps)
578 return
579
580 if command == 'bps':
581 rxbps = system.tsunami.etherdev.rxBandwidth
582 txbps = system.tsunami.etherdev.txBandwidth
581 rxbps = system.tsunami.etherdev0.rxBandwidth
582 txbps = system.tsunami.etherdev0.txBandwidth
583 gbps = (rxbps + txbps) / 1e9
584 if options.graph:
585 graphdata(runs, options, 'bps', 'Bandwidth (Gbps)', gbps)
586 else:
587 printdata(runs, gbps)
588 return
589
590 if command == 'misses':
583 gbps = (rxbps + txbps) / 1e9
584 if options.graph:
585 graphdata(runs, options, 'bps', 'Bandwidth (Gbps)', gbps)
586 else:
587 printdata(runs, gbps)
588 return
589
590 if command == 'misses':
591 stat = system.L2.overall_mshr_misses
591 stat = system.l2.overall_mshr_misses
592 if options.binned:
593 print '%s kernel stats' % stat.name
594 stat.bins = 'kernel'
595 printdata(runs, stat)
596
597 print '%s idle stats' % stat.name
598 stat.bins = 'idle'
599 printdata(runs, stat)

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

607 stat.bins = None
608 if options.graph:
609 graphdata(runs, options, 'misses', 'Overall MSHR Misses', stat)
610 else:
611 printdata(runs, stat)
612 return
613
614 if command == 'mpkb':
592 if options.binned:
593 print '%s kernel stats' % stat.name
594 stat.bins = 'kernel'
595 printdata(runs, stat)
596
597 print '%s idle stats' % stat.name
598 stat.bins = 'idle'
599 printdata(runs, stat)

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

607 stat.bins = None
608 if options.graph:
609 graphdata(runs, options, 'misses', 'Overall MSHR Misses', stat)
610 else:
611 printdata(runs, stat)
612 return
613
614 if command == 'mpkb':
615 misses = system.L2.overall_mshr_misses
616 rxbytes = system.tsunami.etherdev.rxBytes
617 txbytes = system.tsunami.etherdev.txBytes
615 misses = system.l2.overall_mshr_misses
616 rxbytes = system.tsunami.etherdev0.rxBytes
617 txbytes = system.tsunami.etherdev0.txBytes
618
619 if options.binned:
620 print 'mpkb kernel stats'
621 misses.bins = 'kernel'
622 mpkb = misses / ((rxbytes + txbytes) / 1024)
623 printdata(runs, mpkb)
624
625 print 'mpkb idle stats'

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

638 misses.bins = None
639 if options.graph:
640 graphdata(runs, options, 'mpkb', 'Misses / KB', mpkb)
641 else:
642 printdata(runs, mpkb)
643 return
644
645 if command == 'ipkb':
618
619 if options.binned:
620 print 'mpkb kernel stats'
621 misses.bins = 'kernel'
622 mpkb = misses / ((rxbytes + txbytes) / 1024)
623 printdata(runs, mpkb)
624
625 print 'mpkb idle stats'

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

638 misses.bins = None
639 if options.graph:
640 graphdata(runs, options, 'mpkb', 'Misses / KB', mpkb)
641 else:
642 printdata(runs, mpkb)
643 return
644
645 if command == 'ipkb':
646 interrupts = system.full_cpu.kern.faults[4]
647 rxbytes = system.tsunami.etherdev.rxBytes
648 txbytes = system.tsunami.etherdev.txBytes
646 interrupts = system.full0.kern.faults[4]
647 rxbytes = system.tsunami.etherdev0.rxBytes
648 txbytes = system.tsunami.etherdev0.txBytes
649
650 if options.binned:
651 print 'ipkb kernel stats'
652 interrupts.bins = 'kernel'
653 ipkb = interrupts / ((rxbytes + txbytes) / 1024)
654 printdata(runs, ipkb)
655
656 print 'ipkb idle stats'

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

669 interrupts.bins = None
670 if options.graph:
671 graphdata(runs, options, 'ipkb', 'Interrupts / KB', ipkb)
672 else:
673 printdata(runs, ipkb)
674 return
675
676 if command == 'execute':
649
650 if options.binned:
651 print 'ipkb kernel stats'
652 interrupts.bins = 'kernel'
653 ipkb = interrupts / ((rxbytes + txbytes) / 1024)
654 printdata(runs, ipkb)
655
656 print 'ipkb idle stats'

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

669 interrupts.bins = None
670 if options.graph:
671 graphdata(runs, options, 'ipkb', 'Interrupts / KB', ipkb)
672 else:
673 printdata(runs, ipkb)
674 return
675
676 if command == 'execute':
677 printdata(runs, system.full_cpu.ISSUE__count)
677 printdata(runs, system.full0.ISSUE__count)
678 return
679
680 if command == 'commit':
678 return
679
680 if command == 'commit':
681 printdata(runs, system.full_cpu.COM__count)
681 printdata(runs, system.full0.COM__count)
682 return
683
684 if command == 'fetch':
682 return
683
684 if command == 'fetch':
685 printdata(runs, system.full_cpu.FETCH__count)
685 printdata(runs, system.full0.FETCH__count)
686 return
687
688 if command == 'bpp':
686 return
687
688 if command == 'bpp':
689 ed = system.tsunami.etherdev
689 ed = system.tsunami.etherdev0
690 bpp = (ed.rxBytes + ed.txBytes) / (ed.rxPackets + ed.txPackets)
691 if options.graph:
692 graphdata(runs, options, 'bpp', 'Bytes / Packet', bpp)
693 else:
694 printdata(runs, bpp)
695 return
696
697 if command == 'rxbpp':
690 bpp = (ed.rxBytes + ed.txBytes) / (ed.rxPackets + ed.txPackets)
691 if options.graph:
692 graphdata(runs, options, 'bpp', 'Bytes / Packet', bpp)
693 else:
694 printdata(runs, bpp)
695 return
696
697 if command == 'rxbpp':
698 bpp = system.tsunami.etherdev.rxBytes / system.tsunami.etherdev.rxPackets
698 bpp = system.tsunami.etherdev0.rxBytes / system.tsunami.etherdev0.rxPackets
699 if options.graph:
700 graphdata(runs, options, 'rxbpp', 'Receive Bytes / Packet', bpp)
701 else:
702 printdata(runs, bpp)
703 return
704
705 if command == 'txbpp':
699 if options.graph:
700 graphdata(runs, options, 'rxbpp', 'Receive Bytes / Packet', bpp)
701 else:
702 printdata(runs, bpp)
703 return
704
705 if command == 'txbpp':
706 bpp = system.tsunami.etherdev.txBytes / system.tsunami.etherdev.txPackets
706 bpp = system.tsunami.etherdev0.txBytes / system.tsunami.etherdev0.txPackets
707 if options.graph:
708 graphdata(runs, options, 'txbpp', 'Transmit Bytes / Packet', bpp)
709 else:
710 printdata(runs, bpp)
711 return
712
713 if command == 'rtp':
707 if options.graph:
708 graphdata(runs, options, 'txbpp', 'Transmit Bytes / Packet', bpp)
709 else:
710 printdata(runs, bpp)
711 return
712
713 if command == 'rtp':
714 rtp = system.tsunami.etherdev.rxPackets / system.tsunami.etherdev.txPackets
714 rtp = system.tsunami.etherdev0.rxPackets / system.tsunami.etherdev0.txPackets
715 if options.graph:
716 graphdata(runs, options, 'rtp', 'rxPackets / txPackets', rtp)
717 else:
718 printdata(runs, rtp)
719 return
720
721 if command == 'rtb':
715 if options.graph:
716 graphdata(runs, options, 'rtp', 'rxPackets / txPackets', rtp)
717 else:
718 printdata(runs, rtp)
719 return
720
721 if command == 'rtb':
722 rtb = system.tsunami.etherdev.rxBytes / system.tsunami.etherdev.txBytes
722 rtb = system.tsunami.etherdev0.rxBytes / system.tsunami.etherdev0.txBytes
723 if options.graph:
724 graphdata(runs, options, 'rtb', 'rxBytes / txBytes', rtb)
725 else:
726 printdata(runs, rtb)
727 return
728
729 raise CommandException
730

--- 58 unchanged lines hidden ---
723 if options.graph:
724 graphdata(runs, options, 'rtb', 'rxBytes / txBytes', rtb)
725 else:
726 printdata(runs, rtb)
727 return
728
729 raise CommandException
730

--- 58 unchanged lines hidden ---