Profiler.cc (9496:28d88a0fda74) Profiler.cc (9497:2759161b9d7f)
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;

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

219 out << setw(10) << *j;
220 out << setw(11) << count;
221 out << setw(14) << percent << endl;
222 }
223 out << endl;
224}
225
226void
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;

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

219 out << setw(10) << *j;
220 out << setw(11) << count;
221 out << setw(14) << percent << endl;
222 }
223 out << endl;
224}
225
226void
227Profiler::printDelayProfile(ostream &out)
228{
229 out << "Message Delayed Cycles" << endl;
230 out << "----------------------" << endl;
231
232 uint32_t numVNets = Network::getNumberOfVirtualNetworks();
233 Histogram delayHistogram;
234 std::vector<Histogram> delayVCHistogram(numVNets);
235
236 for (uint32_t i = 0; i < MachineType_NUM; i++) {
237 for (map<uint32_t, AbstractController*>::iterator it =
238 g_abs_controls[i].begin();
239 it != g_abs_controls[i].end(); ++it) {
240
241 AbstractController *ctr = (*it).second;
242 delayHistogram.add(ctr->getDelayHist());
243
244 for (uint32_t i = 0; i < numVNets; i++) {
245 delayVCHistogram[i].add(ctr->getDelayVCHist(i));
246 }
247 }
248 }
249
250 out << "Total_delay_cycles: " << delayHistogram << endl;
251
252 for (int i = 0; i < numVNets; i++) {
253 out << " virtual_network_" << i << "_delay_cycles: "
254 << delayVCHistogram[i] << endl;
255 }
256}
257
258void
227Profiler::printStats(ostream& out, bool short_stats)
228{
229 out << endl;
230 if (short_stats) {
231 out << "SHORT ";
232 }
233 out << "Profiler Stats" << endl;
234 out << "--------------" << endl;

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

430 m_address_profiler_ptr->printStats(out);
431 }
432
433 if (m_all_instructions) {
434 m_inst_profiler_ptr->printStats(out);
435 }
436
437 out << endl;
259Profiler::printStats(ostream& out, bool short_stats)
260{
261 out << endl;
262 if (short_stats) {
263 out << "SHORT ";
264 }
265 out << "Profiler Stats" << endl;
266 out << "--------------" << endl;

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

462 m_address_profiler_ptr->printStats(out);
463 }
464
465 if (m_all_instructions) {
466 m_inst_profiler_ptr->printStats(out);
467 }
468
469 out << endl;
438 out << "Message Delayed Cycles" << endl;
439 out << "----------------------" << endl;
440 out << "Total_delay_cycles: " << m_delayedCyclesHistogram << endl;
441 out << "Total_nonPF_delay_cycles: "
442 << m_delayedCyclesNonPFHistogram << endl;
443 for (int i = 0; i < m_delayedCyclesVCHistograms.size(); i++) {
444 out << " virtual_network_" << i << "_delay_cycles: "
445 << m_delayedCyclesVCHistograms[i] << endl;
446 }
447
470 printDelayProfile(out);
448 printResourceUsage(out);
449 }
450}
451
452void
453Profiler::printResourceUsage(ostream& out) const
454{
455 out << endl;

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

483 m_cycles_executed_at_start[i] = 0;
484 } else {
485 m_cycles_executed_at_start[i] = g_system_ptr->getTime();
486 }
487 }
488
489 m_busyBankCount = 0;
490
471 printResourceUsage(out);
472 }
473}
474
475void
476Profiler::printResourceUsage(ostream& out) const
477{
478 out << endl;

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

506 m_cycles_executed_at_start[i] = 0;
507 } else {
508 m_cycles_executed_at_start[i] = g_system_ptr->getTime();
509 }
510 }
511
512 m_busyBankCount = 0;
513
491 m_delayedCyclesHistogram.clear();
492 m_delayedCyclesNonPFHistogram.clear();
493 int size = Network::getNumberOfVirtualNetworks();
494 m_delayedCyclesVCHistograms.resize(size);
495 for (int i = 0; i < size; i++) {
496 m_delayedCyclesVCHistograms[i].clear();
497 }
498
499 m_missLatencyHistograms.resize(RubyRequestType_NUM);
500 for (int i = 0; i < m_missLatencyHistograms.size(); i++) {
501 m_missLatencyHistograms[i].clear(200);
502 }
503 m_machLatencyHistograms.resize(GenericMachineType_NUM+1);
504 for (int i = 0; i < m_machLatencyHistograms.size(); i++) {
505 m_machLatencyHistograms[i].clear(200);
506 }

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

589 if (number_contacted == 0) {
590 m_memory_to_cache++;
591 } else {
592 m_cache_to_cache++;
593 }
594}
595
596void
514 m_missLatencyHistograms.resize(RubyRequestType_NUM);
515 for (int i = 0; i < m_missLatencyHistograms.size(); i++) {
516 m_missLatencyHistograms[i].clear(200);
517 }
518 m_machLatencyHistograms.resize(GenericMachineType_NUM+1);
519 for (int i = 0; i < m_machLatencyHistograms.size(); i++) {
520 m_machLatencyHistograms[i].clear(200);
521 }

--- 82 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
597Profiler::profileMsgDelay(uint32_t virtualNetwork, Time delayCycles)
598{
599 assert(virtualNetwork < m_delayedCyclesVCHistograms.size());
600 m_delayedCyclesHistogram.add(delayCycles);
601 m_delayedCyclesVCHistograms[virtualNetwork].add(delayCycles);
602 if (virtualNetwork != 0) {
603 m_delayedCyclesNonPFHistogram.add(delayCycles);
604 }
605}
606
607void
608Profiler::profilePFWait(Time waitTime)
609{
610 m_prefetchWaitHistogram.add(waitTime);
611}
612
613void
614Profiler::bankBusy()
615{

--- 135 unchanged lines hidden ---
612Profiler::profilePFWait(Time waitTime)
613{
614 m_prefetchWaitHistogram.add(waitTime);
615}
616
617void
618Profiler::bankBusy()
619{

--- 135 unchanged lines hidden ---