Profiler.cc revision 11172
16145Snate@binkert.org/*
210012Snilay@cs.wisc.edu * Copyright (c) 1999-2013 Mark D. Hill and David A. Wood
36145Snate@binkert.org * All rights reserved.
46145Snate@binkert.org *
56145Snate@binkert.org * Redistribution and use in source and binary forms, with or without
66145Snate@binkert.org * modification, are permitted provided that the following conditions are
76145Snate@binkert.org * met: redistributions of source code must retain the above copyright
86145Snate@binkert.org * notice, this list of conditions and the following disclaimer;
96145Snate@binkert.org * redistributions in binary form must reproduce the above copyright
106145Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
116145Snate@binkert.org * documentation and/or other materials provided with the distribution;
126145Snate@binkert.org * neither the name of the copyright holders nor the names of its
136145Snate@binkert.org * contributors may be used to endorse or promote products derived from
146145Snate@binkert.org * this software without specific prior written permission.
156145Snate@binkert.org *
166145Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176145Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186145Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196145Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206145Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216145Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226145Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236145Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246145Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256145Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266145Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276145Snate@binkert.org */
286145Snate@binkert.org
296145Snate@binkert.org/*
306145Snate@binkert.org   This file has been modified by Kevin Moore and Dan Nussbaum of the
316145Snate@binkert.org   Scalable Systems Research Group at Sun Microsystems Laboratories
326145Snate@binkert.org   (http://research.sun.com/scalable/) to support the Adaptive
336145Snate@binkert.org   Transactional Memory Test Platform (ATMTP).
346145Snate@binkert.org
356145Snate@binkert.org   Please send email to atmtp-interest@sun.com with feedback, questions, or
366145Snate@binkert.org   to request future announcements about ATMTP.
376145Snate@binkert.org
386145Snate@binkert.org   ----------------------------------------------------------------------
396145Snate@binkert.org
406145Snate@binkert.org   File modification date: 2008-02-23
416145Snate@binkert.org
426145Snate@binkert.org   ----------------------------------------------------------------------
436145Snate@binkert.org*/
446145Snate@binkert.org
458946Sandreas.hansson@arm.com#include <sys/types.h>
468946Sandreas.hansson@arm.com#include <unistd.h>
477002Snate@binkert.org
487454Snate@binkert.org#include <algorithm>
497832Snate@binkert.org#include <fstream>
507454Snate@binkert.org
517454Snate@binkert.org#include "base/stl_helpers.hh"
527056Snate@binkert.org#include "base/str.hh"
537048Snate@binkert.org#include "mem/protocol/MachineType.hh"
548229Snate@binkert.org#include "mem/protocol/RubyRequest.hh"
557048Snate@binkert.org#include "mem/ruby/network/Network.hh"
567048Snate@binkert.org#include "mem/ruby/profiler/AddressProfiler.hh"
576154Snate@binkert.org#include "mem/ruby/profiler/Profiler.hh"
589598Snilay@cs.wisc.edu#include "mem/ruby/system/Sequencer.hh"
596876Ssteve.reinhardt@amd.com
607055Snate@binkert.orgusing namespace std;
617454Snate@binkert.orgusing m5::stl_helpers::operator<<;
627055Snate@binkert.org
6310920Sbrandon.potter@amd.comProfiler::Profiler(const RubySystemParams *p, RubySystem *rs)
6411172Snilay@cs.wisc.edu    : m_ruby_system(rs), m_hot_lines(p->hot_lines),
6511172Snilay@cs.wisc.edu      m_all_instructions(p->all_instructions),
6611172Snilay@cs.wisc.edu      m_num_vnets(p->number_of_virtual_networks)
676145Snate@binkert.org{
6810919Sbrandon.potter@amd.com    m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
697048Snate@binkert.org    m_address_profiler_ptr->setHotLines(m_hot_lines);
707048Snate@binkert.org    m_address_profiler_ptr->setAllInstructions(m_all_instructions);
716285Snate@binkert.org
727048Snate@binkert.org    if (m_all_instructions) {
7310919Sbrandon.potter@amd.com        m_inst_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
747048Snate@binkert.org        m_inst_profiler_ptr->setHotLines(m_hot_lines);
757048Snate@binkert.org        m_inst_profiler_ptr->setAllInstructions(m_all_instructions);
767048Snate@binkert.org    }
776285Snate@binkert.org}
786285Snate@binkert.org
796889SBrad.Beckmann@amd.comProfiler::~Profiler()
806889SBrad.Beckmann@amd.com{
817048Snate@binkert.org}
827048Snate@binkert.org
837048Snate@binkert.orgvoid
8410012Snilay@cs.wisc.eduProfiler::regStats(const std::string &pName)
857048Snate@binkert.org{
8610012Snilay@cs.wisc.edu    if (!m_all_instructions) {
8710012Snilay@cs.wisc.edu        m_address_profiler_ptr->regStats(pName);
8810012Snilay@cs.wisc.edu    }
8910012Snilay@cs.wisc.edu
9010012Snilay@cs.wisc.edu    if (m_all_instructions) {
9110012Snilay@cs.wisc.edu        m_inst_profiler_ptr->regStats(pName);
9210012Snilay@cs.wisc.edu    }
9310012Snilay@cs.wisc.edu
9410012Snilay@cs.wisc.edu    delayHistogram
9510012Snilay@cs.wisc.edu        .init(10)
9610012Snilay@cs.wisc.edu        .name(pName + ".delayHist")
9710012Snilay@cs.wisc.edu        .desc("delay histogram for all message")
9810012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
9910012Snilay@cs.wisc.edu
10011172Snilay@cs.wisc.edu    for (int i = 0; i < m_num_vnets; i++) {
10110012Snilay@cs.wisc.edu        delayVCHistogram.push_back(new Stats::Histogram());
10210012Snilay@cs.wisc.edu        delayVCHistogram[i]
10310012Snilay@cs.wisc.edu            ->init(10)
10410012Snilay@cs.wisc.edu            .name(pName + csprintf(".delayVCHist.vnet_%i", i))
10510012Snilay@cs.wisc.edu            .desc(csprintf("delay histogram for vnet_%i", i))
10610012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
10710012Snilay@cs.wisc.edu    }
10810012Snilay@cs.wisc.edu
10910012Snilay@cs.wisc.edu    m_outstandReqHist
11010012Snilay@cs.wisc.edu        .init(10)
11110012Snilay@cs.wisc.edu        .name(pName + ".outstanding_req_hist")
11210012Snilay@cs.wisc.edu        .desc("")
11310012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
11410012Snilay@cs.wisc.edu
11510012Snilay@cs.wisc.edu    m_latencyHist
11610012Snilay@cs.wisc.edu        .init(10)
11710012Snilay@cs.wisc.edu        .name(pName + ".latency_hist")
11810012Snilay@cs.wisc.edu        .desc("")
11910012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
12010012Snilay@cs.wisc.edu
12110012Snilay@cs.wisc.edu    m_hitLatencyHist
12210012Snilay@cs.wisc.edu        .init(10)
12310012Snilay@cs.wisc.edu        .name(pName + ".hit_latency_hist")
12410012Snilay@cs.wisc.edu        .desc("")
12510012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
12610012Snilay@cs.wisc.edu
12710012Snilay@cs.wisc.edu    m_missLatencyHist
12810012Snilay@cs.wisc.edu        .init(10)
12910012Snilay@cs.wisc.edu        .name(pName + ".miss_latency_hist")
13010012Snilay@cs.wisc.edu        .desc("")
13110012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
13210012Snilay@cs.wisc.edu
13310012Snilay@cs.wisc.edu    for (int i = 0; i < RubyRequestType_NUM; i++) {
13410012Snilay@cs.wisc.edu        m_typeLatencyHist.push_back(new Stats::Histogram());
13510012Snilay@cs.wisc.edu        m_typeLatencyHist[i]
13610012Snilay@cs.wisc.edu            ->init(10)
13710012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.latency_hist",
13810012Snilay@cs.wisc.edu                                    RubyRequestType(i)))
13910012Snilay@cs.wisc.edu            .desc("")
14010012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
14110012Snilay@cs.wisc.edu
14210012Snilay@cs.wisc.edu        m_hitTypeLatencyHist.push_back(new Stats::Histogram());
14310012Snilay@cs.wisc.edu        m_hitTypeLatencyHist[i]
14410012Snilay@cs.wisc.edu            ->init(10)
14510012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.hit_latency_hist",
14610012Snilay@cs.wisc.edu                                    RubyRequestType(i)))
14710012Snilay@cs.wisc.edu            .desc("")
14810012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
14910012Snilay@cs.wisc.edu
15010012Snilay@cs.wisc.edu        m_missTypeLatencyHist.push_back(new Stats::Histogram());
15110012Snilay@cs.wisc.edu        m_missTypeLatencyHist[i]
15210012Snilay@cs.wisc.edu            ->init(10)
15310012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.miss_latency_hist",
15410012Snilay@cs.wisc.edu                                    RubyRequestType(i)))
15510012Snilay@cs.wisc.edu            .desc("")
15610012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
15710012Snilay@cs.wisc.edu    }
15810012Snilay@cs.wisc.edu
15910012Snilay@cs.wisc.edu    for (int i = 0; i < MachineType_NUM; i++) {
16010012Snilay@cs.wisc.edu        m_hitMachLatencyHist.push_back(new Stats::Histogram());
16110012Snilay@cs.wisc.edu        m_hitMachLatencyHist[i]
16210012Snilay@cs.wisc.edu            ->init(10)
16310012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.hit_mach_latency_hist",
16410012Snilay@cs.wisc.edu                                    MachineType(i)))
16510012Snilay@cs.wisc.edu            .desc("")
16610012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
16710012Snilay@cs.wisc.edu
16810012Snilay@cs.wisc.edu        m_missMachLatencyHist.push_back(new Stats::Histogram());
16910012Snilay@cs.wisc.edu        m_missMachLatencyHist[i]
17010012Snilay@cs.wisc.edu            ->init(10)
17110012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.miss_mach_latency_hist",
17210012Snilay@cs.wisc.edu                                    MachineType(i)))
17310012Snilay@cs.wisc.edu            .desc("")
17410012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
17510012Snilay@cs.wisc.edu
17610012Snilay@cs.wisc.edu        m_IssueToInitialDelayHist.push_back(new Stats::Histogram());
17710012Snilay@cs.wisc.edu        m_IssueToInitialDelayHist[i]
17810012Snilay@cs.wisc.edu            ->init(10)
17910012Snilay@cs.wisc.edu            .name(pName + csprintf(
18010012Snilay@cs.wisc.edu                ".%s.miss_latency_hist.issue_to_initial_request",
18110012Snilay@cs.wisc.edu                MachineType(i)))
18210012Snilay@cs.wisc.edu            .desc("")
18310012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
18410012Snilay@cs.wisc.edu
18510012Snilay@cs.wisc.edu        m_InitialToForwardDelayHist.push_back(new Stats::Histogram());
18610012Snilay@cs.wisc.edu        m_InitialToForwardDelayHist[i]
18710012Snilay@cs.wisc.edu            ->init(10)
18810012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.miss_latency_hist.initial_to_forward",
18910012Snilay@cs.wisc.edu                                   MachineType(i)))
19010012Snilay@cs.wisc.edu            .desc("")
19110012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
19210012Snilay@cs.wisc.edu
19310012Snilay@cs.wisc.edu        m_ForwardToFirstResponseDelayHist.push_back(new Stats::Histogram());
19410012Snilay@cs.wisc.edu        m_ForwardToFirstResponseDelayHist[i]
19510012Snilay@cs.wisc.edu            ->init(10)
19610012Snilay@cs.wisc.edu            .name(pName + csprintf(
19710012Snilay@cs.wisc.edu                ".%s.miss_latency_hist.forward_to_first_response",
19810012Snilay@cs.wisc.edu                MachineType(i)))
19910012Snilay@cs.wisc.edu            .desc("")
20010012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
20110012Snilay@cs.wisc.edu
20210012Snilay@cs.wisc.edu        m_FirstResponseToCompletionDelayHist.push_back(new Stats::Histogram());
20310012Snilay@cs.wisc.edu        m_FirstResponseToCompletionDelayHist[i]
20410012Snilay@cs.wisc.edu            ->init(10)
20510012Snilay@cs.wisc.edu            .name(pName + csprintf(
20610012Snilay@cs.wisc.edu                ".%s.miss_latency_hist.first_response_to_completion",
20710012Snilay@cs.wisc.edu                MachineType(i)))
20810012Snilay@cs.wisc.edu            .desc("")
20910012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
21010012Snilay@cs.wisc.edu
21110012Snilay@cs.wisc.edu        m_IncompleteTimes[i]
21210012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.incomplete_times", MachineType(i)))
21310012Snilay@cs.wisc.edu            .desc("")
21410012Snilay@cs.wisc.edu            .flags(Stats::nozero);
21510012Snilay@cs.wisc.edu    }
21610012Snilay@cs.wisc.edu
21710012Snilay@cs.wisc.edu    for (int i = 0; i < RubyRequestType_NUM; i++) {
21810012Snilay@cs.wisc.edu        m_hitTypeMachLatencyHist.push_back(std::vector<Stats::Histogram *>());
21910012Snilay@cs.wisc.edu        m_missTypeMachLatencyHist.push_back(std::vector<Stats::Histogram *>());
22010012Snilay@cs.wisc.edu
22110012Snilay@cs.wisc.edu        for (int j = 0; j < MachineType_NUM; j++) {
22210012Snilay@cs.wisc.edu            m_hitTypeMachLatencyHist[i].push_back(new Stats::Histogram());
22310012Snilay@cs.wisc.edu            m_hitTypeMachLatencyHist[i][j]
22410012Snilay@cs.wisc.edu                ->init(10)
22510012Snilay@cs.wisc.edu                .name(pName + csprintf(".%s.%s.hit_type_mach_latency_hist",
22610012Snilay@cs.wisc.edu                                       RubyRequestType(i), MachineType(j)))
22710012Snilay@cs.wisc.edu                .desc("")
22810012Snilay@cs.wisc.edu                .flags(Stats::nozero | Stats::pdf | Stats::oneline);
22910012Snilay@cs.wisc.edu
23010012Snilay@cs.wisc.edu            m_missTypeMachLatencyHist[i].push_back(new Stats::Histogram());
23110012Snilay@cs.wisc.edu            m_missTypeMachLatencyHist[i][j]
23210012Snilay@cs.wisc.edu                ->init(10)
23310012Snilay@cs.wisc.edu                .name(pName + csprintf(".%s.%s.miss_type_mach_latency_hist",
23410012Snilay@cs.wisc.edu                                       RubyRequestType(i), MachineType(j)))
23510012Snilay@cs.wisc.edu                .desc("")
23610012Snilay@cs.wisc.edu                .flags(Stats::nozero | Stats::pdf | Stats::oneline);
23710012Snilay@cs.wisc.edu        }
23810012Snilay@cs.wisc.edu    }
2397048Snate@binkert.org}
2407048Snate@binkert.org
2417048Snate@binkert.orgvoid
24210012Snilay@cs.wisc.eduProfiler::collateStats()
2439496Snilay@cs.wisc.edu{
24410012Snilay@cs.wisc.edu    if (!m_all_instructions) {
24510012Snilay@cs.wisc.edu        m_address_profiler_ptr->collateStats();
2469496Snilay@cs.wisc.edu    }
2479496Snilay@cs.wisc.edu
24810012Snilay@cs.wisc.edu    if (m_all_instructions) {
24910012Snilay@cs.wisc.edu        m_inst_profiler_ptr->collateStats();
2509496Snilay@cs.wisc.edu    }
2519497Snilay@cs.wisc.edu
2529497Snilay@cs.wisc.edu    for (uint32_t i = 0; i < MachineType_NUM; i++) {
2539497Snilay@cs.wisc.edu        for (map<uint32_t, AbstractController*>::iterator it =
25410920Sbrandon.potter@amd.com                  m_ruby_system->m_abstract_controls[i].begin();
25510920Sbrandon.potter@amd.com             it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
2569497Snilay@cs.wisc.edu
2579497Snilay@cs.wisc.edu            AbstractController *ctr = (*it).second;
2589497Snilay@cs.wisc.edu            delayHistogram.add(ctr->getDelayHist());
2599497Snilay@cs.wisc.edu
26011172Snilay@cs.wisc.edu            for (uint32_t i = 0; i < m_num_vnets; i++) {
26110012Snilay@cs.wisc.edu                delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
2629497Snilay@cs.wisc.edu            }
2639497Snilay@cs.wisc.edu        }
2649497Snilay@cs.wisc.edu    }
2659497Snilay@cs.wisc.edu
2669598Snilay@cs.wisc.edu    for (uint32_t i = 0; i < MachineType_NUM; i++) {
2679598Snilay@cs.wisc.edu        for (map<uint32_t, AbstractController*>::iterator it =
26810920Sbrandon.potter@amd.com                m_ruby_system->m_abstract_controls[i].begin();
26910920Sbrandon.potter@amd.com                it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
2709598Snilay@cs.wisc.edu
2719598Snilay@cs.wisc.edu            AbstractController *ctr = (*it).second;
2729598Snilay@cs.wisc.edu            Sequencer *seq = ctr->getSequencer();
2739598Snilay@cs.wisc.edu            if (seq != NULL) {
27410012Snilay@cs.wisc.edu                m_outstandReqHist.add(seq->getOutstandReqHist());
2759598Snilay@cs.wisc.edu            }
2769598Snilay@cs.wisc.edu        }
2779598Snilay@cs.wisc.edu    }
2789598Snilay@cs.wisc.edu
2799773Snilay@cs.wisc.edu    for (uint32_t i = 0; i < MachineType_NUM; i++) {
2809773Snilay@cs.wisc.edu        for (map<uint32_t, AbstractController*>::iterator it =
28110920Sbrandon.potter@amd.com                m_ruby_system->m_abstract_controls[i].begin();
28210920Sbrandon.potter@amd.com                it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
2839773Snilay@cs.wisc.edu
2849773Snilay@cs.wisc.edu            AbstractController *ctr = (*it).second;
2859773Snilay@cs.wisc.edu            Sequencer *seq = ctr->getSequencer();
2869773Snilay@cs.wisc.edu            if (seq != NULL) {
2879773Snilay@cs.wisc.edu                // add all the latencies
28810012Snilay@cs.wisc.edu                m_latencyHist.add(seq->getLatencyHist());
28910012Snilay@cs.wisc.edu                m_hitLatencyHist.add(seq->getHitLatencyHist());
29010012Snilay@cs.wisc.edu                m_missLatencyHist.add(seq->getMissLatencyHist());
2919773Snilay@cs.wisc.edu
2929773Snilay@cs.wisc.edu                // add the per request type latencies
2939773Snilay@cs.wisc.edu                for (uint32_t j = 0; j < RubyRequestType_NUM; ++j) {
29410012Snilay@cs.wisc.edu                    m_typeLatencyHist[j]
29510012Snilay@cs.wisc.edu                        ->add(seq->getTypeLatencyHist(j));
29610012Snilay@cs.wisc.edu                    m_hitTypeLatencyHist[j]
29710012Snilay@cs.wisc.edu                        ->add(seq->getHitTypeLatencyHist(j));
29810012Snilay@cs.wisc.edu                    m_missTypeLatencyHist[j]
29910012Snilay@cs.wisc.edu                        ->add(seq->getMissTypeLatencyHist(j));
3009773Snilay@cs.wisc.edu                }
3019773Snilay@cs.wisc.edu
3029773Snilay@cs.wisc.edu                // add the per machine type miss latencies
3039773Snilay@cs.wisc.edu                for (uint32_t j = 0; j < MachineType_NUM; ++j) {
30410012Snilay@cs.wisc.edu                    m_hitMachLatencyHist[j]
30510012Snilay@cs.wisc.edu                        ->add(seq->getHitMachLatencyHist(j));
30610012Snilay@cs.wisc.edu                    m_missMachLatencyHist[j]
30710012Snilay@cs.wisc.edu                        ->add(seq->getMissMachLatencyHist(j));
3089773Snilay@cs.wisc.edu
30910012Snilay@cs.wisc.edu                    m_IssueToInitialDelayHist[j]->add(
3109773Snilay@cs.wisc.edu                        seq->getIssueToInitialDelayHist(MachineType(j)));
3119773Snilay@cs.wisc.edu
31210012Snilay@cs.wisc.edu                    m_InitialToForwardDelayHist[j]->add(
3139773Snilay@cs.wisc.edu                        seq->getInitialToForwardDelayHist(MachineType(j)));
31410012Snilay@cs.wisc.edu                    m_ForwardToFirstResponseDelayHist[j]->add(seq->
3159773Snilay@cs.wisc.edu                        getForwardRequestToFirstResponseHist(MachineType(j)));
3169773Snilay@cs.wisc.edu
31710012Snilay@cs.wisc.edu                    m_FirstResponseToCompletionDelayHist[j]->add(seq->
31810012Snilay@cs.wisc.edu                        getFirstResponseToCompletionDelayHist(
31910012Snilay@cs.wisc.edu                            MachineType(j)));
32010012Snilay@cs.wisc.edu                    m_IncompleteTimes[j] +=
3219773Snilay@cs.wisc.edu                        seq->getIncompleteTimes(MachineType(j));
3229773Snilay@cs.wisc.edu                }
3239773Snilay@cs.wisc.edu
3249773Snilay@cs.wisc.edu                // add the per (request, machine) type miss latencies
3259773Snilay@cs.wisc.edu                for (uint32_t j = 0; j < RubyRequestType_NUM; j++) {
3269773Snilay@cs.wisc.edu                    for (uint32_t k = 0; k < MachineType_NUM; k++) {
32710012Snilay@cs.wisc.edu                        m_hitTypeMachLatencyHist[j][k]->add(
32810012Snilay@cs.wisc.edu                                seq->getHitTypeMachLatencyHist(j,k));
32910012Snilay@cs.wisc.edu                        m_missTypeMachLatencyHist[j][k]->add(
33010012Snilay@cs.wisc.edu                                seq->getMissTypeMachLatencyHist(j,k));
3319773Snilay@cs.wisc.edu                    }
3329773Snilay@cs.wisc.edu                }
3339773Snilay@cs.wisc.edu            }
3349773Snilay@cs.wisc.edu        }
3359773Snilay@cs.wisc.edu    }
3366145Snate@binkert.org}
3376145Snate@binkert.org
3387048Snate@binkert.orgvoid
3398174Snilay@cs.wisc.eduProfiler::addAddressTraceSample(const RubyRequest& msg, NodeID id)
3406145Snate@binkert.org{
3418165Snilay@cs.wisc.edu    if (msg.getType() != RubyRequestType_IFETCH) {
3427048Snate@binkert.org        // Note: The following line should be commented out if you
3437048Snate@binkert.org        // want to use the special profiling that is part of the GS320
3447048Snate@binkert.org        // protocol
3456145Snate@binkert.org
3467048Snate@binkert.org        // NOTE: Unless PROFILE_HOT_LINES is enabled, nothing will be
3477048Snate@binkert.org        // profiled by the AddressProfiler
3487048Snate@binkert.org        m_address_profiler_ptr->
3497048Snate@binkert.org            addTraceSample(msg.getLineAddress(), msg.getProgramCounter(),
3507048Snate@binkert.org                           msg.getType(), msg.getAccessMode(), id, false);
3517048Snate@binkert.org    }
3526145Snate@binkert.org}
353