Profiler.cc (9497:2759161b9d7f) Profiler.cc (9507:d2ab6d889fc7)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

265 out << "Profiler Stats" << endl;
266 out << "--------------" << endl;
267
268 time_t real_time_current = time(NULL);
269 double seconds = difftime(real_time_current, m_real_time_start_time);
270 double minutes = seconds / 60.0;
271 double hours = minutes / 60.0;
272 double days = hours / 24.0;
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

265 out << "Profiler Stats" << endl;
266 out << "--------------" << endl;
267
268 time_t real_time_current = time(NULL);
269 double seconds = difftime(real_time_current, m_real_time_start_time);
270 double minutes = seconds / 60.0;
271 double hours = minutes / 60.0;
272 double days = hours / 24.0;
273 Time ruby_cycles = g_system_ptr->getTime()-m_ruby_start;
273 Cycles ruby_cycles = g_system_ptr->getTime()-m_ruby_start;
274
275 if (!short_stats) {
276 out << "Elapsed_time_in_seconds: " << seconds << endl;
277 out << "Elapsed_time_in_minutes: " << minutes << endl;
278 out << "Elapsed_time_in_hours: " << hours << endl;
279 out << "Elapsed_time_in_days: " << days << endl;
280 out << endl;
281 }

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

604 if (number_contacted == 0) {
605 m_memory_to_cache++;
606 } else {
607 m_cache_to_cache++;
608 }
609}
610
611void
274
275 if (!short_stats) {
276 out << "Elapsed_time_in_seconds: " << seconds << endl;
277 out << "Elapsed_time_in_minutes: " << minutes << endl;
278 out << "Elapsed_time_in_hours: " << hours << endl;
279 out << "Elapsed_time_in_days: " << days << endl;
280 out << endl;
281 }

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

604 if (number_contacted == 0) {
605 m_memory_to_cache++;
606 } else {
607 m_cache_to_cache++;
608 }
609}
610
611void
612Profiler::profilePFWait(Time waitTime)
612Profiler::profilePFWait(Cycles waitTime)
613{
614 m_prefetchWaitHistogram.add(waitTime);
615}
616
617void
618Profiler::bankBusy()
619{
620 m_busyBankCount++;
621}
622
623// non-zero cycle demand request
624void
613{
614 m_prefetchWaitHistogram.add(waitTime);
615}
616
617void
618Profiler::bankBusy()
619{
620 m_busyBankCount++;
621}
622
623// non-zero cycle demand request
624void
625Profiler::missLatency(Time cycles,
625Profiler::missLatency(Cycles cycles,
626 RubyRequestType type,
627 const GenericMachineType respondingMach)
628{
629 m_allMissLatencyHistogram.add(cycles);
630 m_missLatencyHistograms[type].add(cycles);
631 m_machLatencyHistograms[respondingMach].add(cycles);
632 m_missMachLatencyHistograms[type][respondingMach].add(cycles);
633}
634
635void
626 RubyRequestType type,
627 const GenericMachineType respondingMach)
628{
629 m_allMissLatencyHistogram.add(cycles);
630 m_missLatencyHistograms[type].add(cycles);
631 m_machLatencyHistograms[respondingMach].add(cycles);
632 m_missMachLatencyHistograms[type][respondingMach].add(cycles);
633}
634
635void
636Profiler::missLatencyWcc(Time issuedTime,
637 Time initialRequestTime,
638 Time forwardRequestTime,
639 Time firstResponseTime,
640 Time completionTime)
636Profiler::missLatencyWcc(Cycles issuedTime,
637 Cycles initialRequestTime,
638 Cycles forwardRequestTime,
639 Cycles firstResponseTime,
640 Cycles completionTime)
641{
642 if ((issuedTime <= initialRequestTime) &&
643 (initialRequestTime <= forwardRequestTime) &&
644 (forwardRequestTime <= firstResponseTime) &&
645 (firstResponseTime <= completionTime)) {
646 m_wCCIssueToInitialRequestHistogram.add(initialRequestTime - issuedTime);
647
648 m_wCCInitialRequestToForwardRequestHistogram.add(forwardRequestTime -

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

654 m_wCCFirstResponseToCompleteHistogram.add(completionTime -
655 firstResponseTime);
656 } else {
657 m_wCCIncompleteTimes++;
658 }
659}
660
661void
641{
642 if ((issuedTime <= initialRequestTime) &&
643 (initialRequestTime <= forwardRequestTime) &&
644 (forwardRequestTime <= firstResponseTime) &&
645 (firstResponseTime <= completionTime)) {
646 m_wCCIssueToInitialRequestHistogram.add(initialRequestTime - issuedTime);
647
648 m_wCCInitialRequestToForwardRequestHistogram.add(forwardRequestTime -

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

654 m_wCCFirstResponseToCompleteHistogram.add(completionTime -
655 firstResponseTime);
656 } else {
657 m_wCCIncompleteTimes++;
658 }
659}
660
661void
662Profiler::missLatencyDir(Time issuedTime,
663 Time initialRequestTime,
664 Time forwardRequestTime,
665 Time firstResponseTime,
666 Time completionTime)
662Profiler::missLatencyDir(Cycles issuedTime,
663 Cycles initialRequestTime,
664 Cycles forwardRequestTime,
665 Cycles firstResponseTime,
666 Cycles completionTime)
667{
668 if ((issuedTime <= initialRequestTime) &&
669 (initialRequestTime <= forwardRequestTime) &&
670 (forwardRequestTime <= firstResponseTime) &&
671 (firstResponseTime <= completionTime)) {
672 m_dirIssueToInitialRequestHistogram.add(initialRequestTime - issuedTime);
673
674 m_dirInitialRequestToForwardRequestHistogram.add(forwardRequestTime -

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

681 firstResponseTime);
682 } else {
683 m_dirIncompleteTimes++;
684 }
685}
686
687// non-zero cycle prefetch request
688void
667{
668 if ((issuedTime <= initialRequestTime) &&
669 (initialRequestTime <= forwardRequestTime) &&
670 (forwardRequestTime <= firstResponseTime) &&
671 (firstResponseTime <= completionTime)) {
672 m_dirIssueToInitialRequestHistogram.add(initialRequestTime - issuedTime);
673
674 m_dirInitialRequestToForwardRequestHistogram.add(forwardRequestTime -

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

681 firstResponseTime);
682 } else {
683 m_dirIncompleteTimes++;
684 }
685}
686
687// non-zero cycle prefetch request
688void
689Profiler::swPrefetchLatency(Time cycles,
690 RubyRequestType type,
689Profiler::swPrefetchLatency(Cycles cycles, RubyRequestType type,
691 const GenericMachineType respondingMach)
692{
693 m_allSWPrefetchLatencyHistogram.add(cycles);
694 m_SWPrefetchLatencyHistograms[type].add(cycles);
695 m_SWPrefetchMachLatencyHistograms[respondingMach].add(cycles);
690 const GenericMachineType respondingMach)
691{
692 m_allSWPrefetchLatencyHistogram.add(cycles);
693 m_SWPrefetchLatencyHistograms[type].add(cycles);
694 m_SWPrefetchMachLatencyHistograms[respondingMach].add(cycles);
695
696 if (respondingMach == GenericMachineType_Directory ||
697 respondingMach == GenericMachineType_NUM) {
698 m_SWPrefetchL2MissLatencyHistogram.add(cycles);
699 }
700}
701
702// Helper function
703static double

--- 51 unchanged lines hidden ---
696 if (respondingMach == GenericMachineType_Directory ||
697 respondingMach == GenericMachineType_NUM) {
698 m_SWPrefetchL2MissLatencyHistogram.add(cycles);
699 }
700}
701
702// Helper function
703static double

--- 51 unchanged lines hidden ---