1/* 2 * Copyright (c) 1999-2013 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; --- 42 unchanged lines hidden (view full) --- 51#include <fstream> 52 53#include "base/stl_helpers.hh" 54#include "base/str.hh" 55#include "mem/protocol/MachineType.hh" 56#include "mem/protocol/RubyRequest.hh" 57#include "mem/ruby/network/Network.hh" 58#include "mem/ruby/profiler/AddressProfiler.hh" |
59 60/** 61 * the profiler uses GPUCoalescer code even 62 * though the GPUCoalescer is not built for 63 * all ISAs, which can lead to run/link time 64 * errors. here we guard the coalescer code 65 * with ifdefs as there is no easy way to 66 * refactor this code without removing 67 * GPUCoalescer stats from the profiler. 68 * 69 * eventually we should use probe points 70 * here, but until then these ifdefs will 71 * serve. 72 */ 73#ifdef BUILD_GPU |
74#include "mem/ruby/system/GPUCoalescer.hh" |
75#endif 76 |
77#include "mem/ruby/system/Sequencer.hh" 78 79using namespace std; 80using m5::stl_helpers::operator<<; 81 82Profiler::Profiler(const RubySystemParams *p, RubySystem *rs) 83 : m_ruby_system(rs), m_hot_lines(p->hot_lines), 84 m_all_instructions(p->all_instructions), --- 288 unchanged lines hidden (view full) --- 373 m_ruby_system->m_abstract_controls[i].begin(); 374 it != m_ruby_system->m_abstract_controls[i].end(); ++it) { 375 376 AbstractController *ctr = (*it).second; 377 Sequencer *seq = ctr->getCPUSequencer(); 378 if (seq != NULL) { 379 m_outstandReqHistSeqr.add(seq->getOutstandReqHist()); 380 } |
381#ifdef BUILD_GPU |
382 GPUCoalescer *coal = ctr->getGPUCoalescer(); 383 if (coal != NULL) { 384 m_outstandReqHistCoalsr.add(coal->getOutstandReqHist()); 385 } |
386#endif |
387 } 388 } 389 390 for (uint32_t i = 0; i < MachineType_NUM; i++) { 391 for (map<uint32_t, AbstractController*>::iterator it = 392 m_ruby_system->m_abstract_controls[i].begin(); 393 it != m_ruby_system->m_abstract_controls[i].end(); ++it) { 394 --- 42 unchanged lines hidden (view full) --- 437 for (uint32_t k = 0; k < MachineType_NUM; k++) { 438 m_hitTypeMachLatencyHistSeqr[j][k]->add( 439 seq->getHitTypeMachLatencyHist(j,k)); 440 m_missTypeMachLatencyHistSeqr[j][k]->add( 441 seq->getMissTypeMachLatencyHist(j,k)); 442 } 443 } 444 } |
445#ifdef BUILD_GPU |
446 GPUCoalescer *coal = ctr->getGPUCoalescer(); 447 if (coal != NULL) { 448 // add all the latencies 449 m_latencyHistCoalsr.add(coal->getLatencyHist()); 450 m_missLatencyHistCoalsr.add(coal->getMissLatencyHist()); 451 452 // add the per request type latencies 453 for (uint32_t j = 0; j < RubyRequestType_NUM; ++j) { --- 24 unchanged lines hidden (view full) --- 478 // add the per (request, machine) type miss latencies 479 for (uint32_t j = 0; j < RubyRequestType_NUM; j++) { 480 for (uint32_t k = 0; k < MachineType_NUM; k++) { 481 m_missTypeMachLatencyHistCoalsr[j][k]->add( 482 coal->getMissTypeMachLatencyHist(j,k)); 483 } 484 } 485 } |
486#endif |
487 } 488 } 489} 490 491void 492Profiler::addAddressTraceSample(const RubyRequest& msg, NodeID id) 493{ 494 if (msg.getType() != RubyRequestType_IFETCH) { 495 // Note: The following line should be commented out if you 496 // want to use the special profiling that is part of the GS320 497 // protocol 498 499 // NOTE: Unless PROFILE_HOT_LINES is enabled, nothing will be 500 // profiled by the AddressProfiler 501 m_address_profiler_ptr-> 502 addTraceSample(msg.getLineAddress(), msg.getProgramCounter(), 503 msg.getType(), msg.getAccessMode(), id, false); 504 } 505} |