Profiler.cc (11309:9be8a40026df) Profiler.cc (11798:e034a4566653)
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"
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
59#include "mem/ruby/system/GPUCoalescer.hh"
74#include "mem/ruby/system/GPUCoalescer.hh"
75#endif
76
60#include "mem/ruby/system/Sequencer.hh"
61
62using namespace std;
63using m5::stl_helpers::operator<<;
64
65Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
66 : m_ruby_system(rs), m_hot_lines(p->hot_lines),
67 m_all_instructions(p->all_instructions),

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

356 m_ruby_system->m_abstract_controls[i].begin();
357 it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
358
359 AbstractController *ctr = (*it).second;
360 Sequencer *seq = ctr->getCPUSequencer();
361 if (seq != NULL) {
362 m_outstandReqHistSeqr.add(seq->getOutstandReqHist());
363 }
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
364 GPUCoalescer *coal = ctr->getGPUCoalescer();
365 if (coal != NULL) {
366 m_outstandReqHistCoalsr.add(coal->getOutstandReqHist());
367 }
382 GPUCoalescer *coal = ctr->getGPUCoalescer();
383 if (coal != NULL) {
384 m_outstandReqHistCoalsr.add(coal->getOutstandReqHist());
385 }
386#endif
368 }
369 }
370
371 for (uint32_t i = 0; i < MachineType_NUM; i++) {
372 for (map<uint32_t, AbstractController*>::iterator it =
373 m_ruby_system->m_abstract_controls[i].begin();
374 it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
375

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

418 for (uint32_t k = 0; k < MachineType_NUM; k++) {
419 m_hitTypeMachLatencyHistSeqr[j][k]->add(
420 seq->getHitTypeMachLatencyHist(j,k));
421 m_missTypeMachLatencyHistSeqr[j][k]->add(
422 seq->getMissTypeMachLatencyHist(j,k));
423 }
424 }
425 }
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 }
426
445#ifdef BUILD_GPU
427 GPUCoalescer *coal = ctr->getGPUCoalescer();
428 if (coal != NULL) {
429 // add all the latencies
430 m_latencyHistCoalsr.add(coal->getLatencyHist());
431 m_missLatencyHistCoalsr.add(coal->getMissLatencyHist());
432
433 // add the per request type latencies
434 for (uint32_t j = 0; j < RubyRequestType_NUM; ++j) {

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

459 // add the per (request, machine) type miss latencies
460 for (uint32_t j = 0; j < RubyRequestType_NUM; j++) {
461 for (uint32_t k = 0; k < MachineType_NUM; k++) {
462 m_missTypeMachLatencyHistCoalsr[j][k]->add(
463 coal->getMissTypeMachLatencyHist(j,k));
464 }
465 }
466 }
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
467 }
468 }
469}
470
471void
472Profiler::addAddressTraceSample(const RubyRequest& msg, NodeID id)
473{
474 if (msg.getType() != RubyRequestType_IFETCH) {
475 // Note: The following line should be commented out if you
476 // want to use the special profiling that is part of the GS320
477 // protocol
478
479 // NOTE: Unless PROFILE_HOT_LINES is enabled, nothing will be
480 // profiled by the AddressProfiler
481 m_address_profiler_ptr->
482 addTraceSample(msg.getLineAddress(), msg.getProgramCounter(),
483 msg.getType(), msg.getAccessMode(), id, false);
484 }
485}
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}