Profiler.cc revision 10012
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"
596154Snate@binkert.org#include "mem/ruby/system/System.hh"
606876Ssteve.reinhardt@amd.com
617055Snate@binkert.orgusing namespace std;
627454Snate@binkert.orgusing m5::stl_helpers::operator<<;
637055Snate@binkert.org
6410012Snilay@cs.wisc.eduProfiler::Profiler(const RubySystemParams *p)
6510012Snilay@cs.wisc.edu    : m_IncompleteTimes(MachineType_NUM)
666145Snate@binkert.org{
677048Snate@binkert.org    m_hot_lines = p->hot_lines;
687048Snate@binkert.org    m_all_instructions = p->all_instructions;
696876Ssteve.reinhardt@amd.com
7010012Snilay@cs.wisc.edu    m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers);
717048Snate@binkert.org    m_address_profiler_ptr->setHotLines(m_hot_lines);
727048Snate@binkert.org    m_address_profiler_ptr->setAllInstructions(m_all_instructions);
736285Snate@binkert.org
747048Snate@binkert.org    if (m_all_instructions) {
7510012Snilay@cs.wisc.edu        m_inst_profiler_ptr = new AddressProfiler(p->num_of_sequencers);
767048Snate@binkert.org        m_inst_profiler_ptr->setHotLines(m_hot_lines);
777048Snate@binkert.org        m_inst_profiler_ptr->setAllInstructions(m_all_instructions);
787048Snate@binkert.org    }
796285Snate@binkert.org}
806285Snate@binkert.org
816889SBrad.Beckmann@amd.comProfiler::~Profiler()
826889SBrad.Beckmann@amd.com{
837048Snate@binkert.org}
847048Snate@binkert.org
857048Snate@binkert.orgvoid
8610012Snilay@cs.wisc.eduProfiler::regStats(const std::string &pName)
877048Snate@binkert.org{
8810012Snilay@cs.wisc.edu    if (!m_all_instructions) {
8910012Snilay@cs.wisc.edu        m_address_profiler_ptr->regStats(pName);
9010012Snilay@cs.wisc.edu    }
9110012Snilay@cs.wisc.edu
9210012Snilay@cs.wisc.edu    if (m_all_instructions) {
9310012Snilay@cs.wisc.edu        m_inst_profiler_ptr->regStats(pName);
9410012Snilay@cs.wisc.edu    }
9510012Snilay@cs.wisc.edu
9610012Snilay@cs.wisc.edu    delayHistogram
9710012Snilay@cs.wisc.edu        .init(10)
9810012Snilay@cs.wisc.edu        .name(pName + ".delayHist")
9910012Snilay@cs.wisc.edu        .desc("delay histogram for all message")
10010012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
10110012Snilay@cs.wisc.edu
10210012Snilay@cs.wisc.edu    uint32_t numVNets = Network::getNumberOfVirtualNetworks();
10310012Snilay@cs.wisc.edu    for (int i = 0; i < numVNets; i++) {
10410012Snilay@cs.wisc.edu        delayVCHistogram.push_back(new Stats::Histogram());
10510012Snilay@cs.wisc.edu        delayVCHistogram[i]
10610012Snilay@cs.wisc.edu            ->init(10)
10710012Snilay@cs.wisc.edu            .name(pName + csprintf(".delayVCHist.vnet_%i", i))
10810012Snilay@cs.wisc.edu            .desc(csprintf("delay histogram for vnet_%i", i))
10910012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
11010012Snilay@cs.wisc.edu    }
11110012Snilay@cs.wisc.edu
11210012Snilay@cs.wisc.edu    m_outstandReqHist
11310012Snilay@cs.wisc.edu        .init(10)
11410012Snilay@cs.wisc.edu        .name(pName + ".outstanding_req_hist")
11510012Snilay@cs.wisc.edu        .desc("")
11610012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
11710012Snilay@cs.wisc.edu
11810012Snilay@cs.wisc.edu    m_latencyHist
11910012Snilay@cs.wisc.edu        .init(10)
12010012Snilay@cs.wisc.edu        .name(pName + ".latency_hist")
12110012Snilay@cs.wisc.edu        .desc("")
12210012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
12310012Snilay@cs.wisc.edu
12410012Snilay@cs.wisc.edu    m_hitLatencyHist
12510012Snilay@cs.wisc.edu        .init(10)
12610012Snilay@cs.wisc.edu        .name(pName + ".hit_latency_hist")
12710012Snilay@cs.wisc.edu        .desc("")
12810012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
12910012Snilay@cs.wisc.edu
13010012Snilay@cs.wisc.edu    m_missLatencyHist
13110012Snilay@cs.wisc.edu        .init(10)
13210012Snilay@cs.wisc.edu        .name(pName + ".miss_latency_hist")
13310012Snilay@cs.wisc.edu        .desc("")
13410012Snilay@cs.wisc.edu        .flags(Stats::nozero | Stats::pdf | Stats::oneline);
13510012Snilay@cs.wisc.edu
13610012Snilay@cs.wisc.edu    for (int i = 0; i < RubyRequestType_NUM; i++) {
13710012Snilay@cs.wisc.edu        m_typeLatencyHist.push_back(new Stats::Histogram());
13810012Snilay@cs.wisc.edu        m_typeLatencyHist[i]
13910012Snilay@cs.wisc.edu            ->init(10)
14010012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.latency_hist",
14110012Snilay@cs.wisc.edu                                    RubyRequestType(i)))
14210012Snilay@cs.wisc.edu            .desc("")
14310012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
14410012Snilay@cs.wisc.edu
14510012Snilay@cs.wisc.edu        m_hitTypeLatencyHist.push_back(new Stats::Histogram());
14610012Snilay@cs.wisc.edu        m_hitTypeLatencyHist[i]
14710012Snilay@cs.wisc.edu            ->init(10)
14810012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.hit_latency_hist",
14910012Snilay@cs.wisc.edu                                    RubyRequestType(i)))
15010012Snilay@cs.wisc.edu            .desc("")
15110012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
15210012Snilay@cs.wisc.edu
15310012Snilay@cs.wisc.edu        m_missTypeLatencyHist.push_back(new Stats::Histogram());
15410012Snilay@cs.wisc.edu        m_missTypeLatencyHist[i]
15510012Snilay@cs.wisc.edu            ->init(10)
15610012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.miss_latency_hist",
15710012Snilay@cs.wisc.edu                                    RubyRequestType(i)))
15810012Snilay@cs.wisc.edu            .desc("")
15910012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
16010012Snilay@cs.wisc.edu    }
16110012Snilay@cs.wisc.edu
16210012Snilay@cs.wisc.edu    for (int i = 0; i < MachineType_NUM; i++) {
16310012Snilay@cs.wisc.edu        m_hitMachLatencyHist.push_back(new Stats::Histogram());
16410012Snilay@cs.wisc.edu        m_hitMachLatencyHist[i]
16510012Snilay@cs.wisc.edu            ->init(10)
16610012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.hit_mach_latency_hist",
16710012Snilay@cs.wisc.edu                                    MachineType(i)))
16810012Snilay@cs.wisc.edu            .desc("")
16910012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
17010012Snilay@cs.wisc.edu
17110012Snilay@cs.wisc.edu        m_missMachLatencyHist.push_back(new Stats::Histogram());
17210012Snilay@cs.wisc.edu        m_missMachLatencyHist[i]
17310012Snilay@cs.wisc.edu            ->init(10)
17410012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.miss_mach_latency_hist",
17510012Snilay@cs.wisc.edu                                    MachineType(i)))
17610012Snilay@cs.wisc.edu            .desc("")
17710012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
17810012Snilay@cs.wisc.edu
17910012Snilay@cs.wisc.edu        m_IssueToInitialDelayHist.push_back(new Stats::Histogram());
18010012Snilay@cs.wisc.edu        m_IssueToInitialDelayHist[i]
18110012Snilay@cs.wisc.edu            ->init(10)
18210012Snilay@cs.wisc.edu            .name(pName + csprintf(
18310012Snilay@cs.wisc.edu                ".%s.miss_latency_hist.issue_to_initial_request",
18410012Snilay@cs.wisc.edu                MachineType(i)))
18510012Snilay@cs.wisc.edu            .desc("")
18610012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
18710012Snilay@cs.wisc.edu
18810012Snilay@cs.wisc.edu        m_InitialToForwardDelayHist.push_back(new Stats::Histogram());
18910012Snilay@cs.wisc.edu        m_InitialToForwardDelayHist[i]
19010012Snilay@cs.wisc.edu            ->init(10)
19110012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.miss_latency_hist.initial_to_forward",
19210012Snilay@cs.wisc.edu                                   MachineType(i)))
19310012Snilay@cs.wisc.edu            .desc("")
19410012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
19510012Snilay@cs.wisc.edu
19610012Snilay@cs.wisc.edu        m_ForwardToFirstResponseDelayHist.push_back(new Stats::Histogram());
19710012Snilay@cs.wisc.edu        m_ForwardToFirstResponseDelayHist[i]
19810012Snilay@cs.wisc.edu            ->init(10)
19910012Snilay@cs.wisc.edu            .name(pName + csprintf(
20010012Snilay@cs.wisc.edu                ".%s.miss_latency_hist.forward_to_first_response",
20110012Snilay@cs.wisc.edu                MachineType(i)))
20210012Snilay@cs.wisc.edu            .desc("")
20310012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
20410012Snilay@cs.wisc.edu
20510012Snilay@cs.wisc.edu        m_FirstResponseToCompletionDelayHist.push_back(new Stats::Histogram());
20610012Snilay@cs.wisc.edu        m_FirstResponseToCompletionDelayHist[i]
20710012Snilay@cs.wisc.edu            ->init(10)
20810012Snilay@cs.wisc.edu            .name(pName + csprintf(
20910012Snilay@cs.wisc.edu                ".%s.miss_latency_hist.first_response_to_completion",
21010012Snilay@cs.wisc.edu                MachineType(i)))
21110012Snilay@cs.wisc.edu            .desc("")
21210012Snilay@cs.wisc.edu            .flags(Stats::nozero | Stats::pdf | Stats::oneline);
21310012Snilay@cs.wisc.edu
21410012Snilay@cs.wisc.edu        m_IncompleteTimes[i]
21510012Snilay@cs.wisc.edu            .name(pName + csprintf(".%s.incomplete_times", MachineType(i)))
21610012Snilay@cs.wisc.edu            .desc("")
21710012Snilay@cs.wisc.edu            .flags(Stats::nozero);
21810012Snilay@cs.wisc.edu    }
21910012Snilay@cs.wisc.edu
22010012Snilay@cs.wisc.edu    for (int i = 0; i < RubyRequestType_NUM; i++) {
22110012Snilay@cs.wisc.edu        m_hitTypeMachLatencyHist.push_back(std::vector<Stats::Histogram *>());
22210012Snilay@cs.wisc.edu        m_missTypeMachLatencyHist.push_back(std::vector<Stats::Histogram *>());
22310012Snilay@cs.wisc.edu
22410012Snilay@cs.wisc.edu        for (int j = 0; j < MachineType_NUM; j++) {
22510012Snilay@cs.wisc.edu            m_hitTypeMachLatencyHist[i].push_back(new Stats::Histogram());
22610012Snilay@cs.wisc.edu            m_hitTypeMachLatencyHist[i][j]
22710012Snilay@cs.wisc.edu                ->init(10)
22810012Snilay@cs.wisc.edu                .name(pName + csprintf(".%s.%s.hit_type_mach_latency_hist",
22910012Snilay@cs.wisc.edu                                       RubyRequestType(i), MachineType(j)))
23010012Snilay@cs.wisc.edu                .desc("")
23110012Snilay@cs.wisc.edu                .flags(Stats::nozero | Stats::pdf | Stats::oneline);
23210012Snilay@cs.wisc.edu
23310012Snilay@cs.wisc.edu            m_missTypeMachLatencyHist[i].push_back(new Stats::Histogram());
23410012Snilay@cs.wisc.edu            m_missTypeMachLatencyHist[i][j]
23510012Snilay@cs.wisc.edu                ->init(10)
23610012Snilay@cs.wisc.edu                .name(pName + csprintf(".%s.%s.miss_type_mach_latency_hist",
23710012Snilay@cs.wisc.edu                                       RubyRequestType(i), MachineType(j)))
23810012Snilay@cs.wisc.edu                .desc("")
23910012Snilay@cs.wisc.edu                .flags(Stats::nozero | Stats::pdf | Stats::oneline);
24010012Snilay@cs.wisc.edu        }
24110012Snilay@cs.wisc.edu    }
2427048Snate@binkert.org}
2437048Snate@binkert.org
2447048Snate@binkert.orgvoid
24510012Snilay@cs.wisc.eduProfiler::collateStats()
2469496Snilay@cs.wisc.edu{
24710012Snilay@cs.wisc.edu    if (!m_all_instructions) {
24810012Snilay@cs.wisc.edu        m_address_profiler_ptr->collateStats();
2499496Snilay@cs.wisc.edu    }
2509496Snilay@cs.wisc.edu
25110012Snilay@cs.wisc.edu    if (m_all_instructions) {
25210012Snilay@cs.wisc.edu        m_inst_profiler_ptr->collateStats();
2539496Snilay@cs.wisc.edu    }
2549497Snilay@cs.wisc.edu
2559497Snilay@cs.wisc.edu    uint32_t numVNets = Network::getNumberOfVirtualNetworks();
2569497Snilay@cs.wisc.edu    for (uint32_t i = 0; i < MachineType_NUM; i++) {
2579497Snilay@cs.wisc.edu        for (map<uint32_t, AbstractController*>::iterator it =
2589497Snilay@cs.wisc.edu                  g_abs_controls[i].begin();
2599497Snilay@cs.wisc.edu             it != g_abs_controls[i].end(); ++it) {
2609497Snilay@cs.wisc.edu
2619497Snilay@cs.wisc.edu            AbstractController *ctr = (*it).second;
2629497Snilay@cs.wisc.edu            delayHistogram.add(ctr->getDelayHist());
2639497Snilay@cs.wisc.edu
2649497Snilay@cs.wisc.edu            for (uint32_t i = 0; i < numVNets; i++) {
26510012Snilay@cs.wisc.edu                delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
2669497Snilay@cs.wisc.edu            }
2679497Snilay@cs.wisc.edu        }
2689497Snilay@cs.wisc.edu    }
2699497Snilay@cs.wisc.edu
2709598Snilay@cs.wisc.edu    for (uint32_t i = 0; i < MachineType_NUM; i++) {
2719598Snilay@cs.wisc.edu        for (map<uint32_t, AbstractController*>::iterator it =
27210012Snilay@cs.wisc.edu                g_abs_controls[i].begin();
27310012Snilay@cs.wisc.edu                it != g_abs_controls[i].end(); ++it) {
2749598Snilay@cs.wisc.edu
2759598Snilay@cs.wisc.edu            AbstractController *ctr = (*it).second;
2769598Snilay@cs.wisc.edu            Sequencer *seq = ctr->getSequencer();
2779598Snilay@cs.wisc.edu            if (seq != NULL) {
27810012Snilay@cs.wisc.edu                m_outstandReqHist.add(seq->getOutstandReqHist());
2799598Snilay@cs.wisc.edu            }
2809598Snilay@cs.wisc.edu        }
2819598Snilay@cs.wisc.edu    }
2829598Snilay@cs.wisc.edu
2839773Snilay@cs.wisc.edu    for (uint32_t i = 0; i < MachineType_NUM; i++) {
2849773Snilay@cs.wisc.edu        for (map<uint32_t, AbstractController*>::iterator it =
28510012Snilay@cs.wisc.edu                g_abs_controls[i].begin();
28610012Snilay@cs.wisc.edu                it != g_abs_controls[i].end(); ++it) {
2879773Snilay@cs.wisc.edu
2889773Snilay@cs.wisc.edu            AbstractController *ctr = (*it).second;
2899773Snilay@cs.wisc.edu            Sequencer *seq = ctr->getSequencer();
2909773Snilay@cs.wisc.edu            if (seq != NULL) {
2919773Snilay@cs.wisc.edu                // add all the latencies
29210012Snilay@cs.wisc.edu                m_latencyHist.add(seq->getLatencyHist());
29310012Snilay@cs.wisc.edu                m_hitLatencyHist.add(seq->getHitLatencyHist());
29410012Snilay@cs.wisc.edu                m_missLatencyHist.add(seq->getMissLatencyHist());
2959773Snilay@cs.wisc.edu
2969773Snilay@cs.wisc.edu                // add the per request type latencies
2979773Snilay@cs.wisc.edu                for (uint32_t j = 0; j < RubyRequestType_NUM; ++j) {
29810012Snilay@cs.wisc.edu                    m_typeLatencyHist[j]
29910012Snilay@cs.wisc.edu                        ->add(seq->getTypeLatencyHist(j));
30010012Snilay@cs.wisc.edu                    m_hitTypeLatencyHist[j]
30110012Snilay@cs.wisc.edu                        ->add(seq->getHitTypeLatencyHist(j));
30210012Snilay@cs.wisc.edu                    m_missTypeLatencyHist[j]
30310012Snilay@cs.wisc.edu                        ->add(seq->getMissTypeLatencyHist(j));
3049773Snilay@cs.wisc.edu                }
3059773Snilay@cs.wisc.edu
3069773Snilay@cs.wisc.edu                // add the per machine type miss latencies
3079773Snilay@cs.wisc.edu                for (uint32_t j = 0; j < MachineType_NUM; ++j) {
30810012Snilay@cs.wisc.edu                    m_hitMachLatencyHist[j]
30910012Snilay@cs.wisc.edu                        ->add(seq->getHitMachLatencyHist(j));
31010012Snilay@cs.wisc.edu                    m_missMachLatencyHist[j]
31110012Snilay@cs.wisc.edu                        ->add(seq->getMissMachLatencyHist(j));
3129773Snilay@cs.wisc.edu
31310012Snilay@cs.wisc.edu                    m_IssueToInitialDelayHist[j]->add(
3149773Snilay@cs.wisc.edu                        seq->getIssueToInitialDelayHist(MachineType(j)));
3159773Snilay@cs.wisc.edu
31610012Snilay@cs.wisc.edu                    m_InitialToForwardDelayHist[j]->add(
3179773Snilay@cs.wisc.edu                        seq->getInitialToForwardDelayHist(MachineType(j)));
31810012Snilay@cs.wisc.edu                    m_ForwardToFirstResponseDelayHist[j]->add(seq->
3199773Snilay@cs.wisc.edu                        getForwardRequestToFirstResponseHist(MachineType(j)));
3209773Snilay@cs.wisc.edu
32110012Snilay@cs.wisc.edu                    m_FirstResponseToCompletionDelayHist[j]->add(seq->
32210012Snilay@cs.wisc.edu                        getFirstResponseToCompletionDelayHist(
32310012Snilay@cs.wisc.edu                            MachineType(j)));
32410012Snilay@cs.wisc.edu                    m_IncompleteTimes[j] +=
3259773Snilay@cs.wisc.edu                        seq->getIncompleteTimes(MachineType(j));
3269773Snilay@cs.wisc.edu                }
3279773Snilay@cs.wisc.edu
3289773Snilay@cs.wisc.edu                // add the per (request, machine) type miss latencies
3299773Snilay@cs.wisc.edu                for (uint32_t j = 0; j < RubyRequestType_NUM; j++) {
3309773Snilay@cs.wisc.edu                    for (uint32_t k = 0; k < MachineType_NUM; k++) {
33110012Snilay@cs.wisc.edu                        m_hitTypeMachLatencyHist[j][k]->add(
33210012Snilay@cs.wisc.edu                                seq->getHitTypeMachLatencyHist(j,k));
33310012Snilay@cs.wisc.edu                        m_missTypeMachLatencyHist[j][k]->add(
33410012Snilay@cs.wisc.edu                                seq->getMissTypeMachLatencyHist(j,k));
3359773Snilay@cs.wisc.edu                    }
3369773Snilay@cs.wisc.edu                }
3379773Snilay@cs.wisc.edu            }
3389773Snilay@cs.wisc.edu        }
3399773Snilay@cs.wisc.edu    }
3406145Snate@binkert.org}
3416145Snate@binkert.org
3427048Snate@binkert.orgvoid
3438174Snilay@cs.wisc.eduProfiler::addAddressTraceSample(const RubyRequest& msg, NodeID id)
3446145Snate@binkert.org{
3458165Snilay@cs.wisc.edu    if (msg.getType() != RubyRequestType_IFETCH) {
3467048Snate@binkert.org        // Note: The following line should be commented out if you
3477048Snate@binkert.org        // want to use the special profiling that is part of the GS320
3487048Snate@binkert.org        // protocol
3496145Snate@binkert.org
3507048Snate@binkert.org        // NOTE: Unless PROFILE_HOT_LINES is enabled, nothing will be
3517048Snate@binkert.org        // profiled by the AddressProfiler
3527048Snate@binkert.org        m_address_profiler_ptr->
3537048Snate@binkert.org            addTraceSample(msg.getLineAddress(), msg.getProgramCounter(),
3547048Snate@binkert.org                           msg.getType(), msg.getAccessMode(), id, false);
3557048Snate@binkert.org    }
3566145Snate@binkert.org}
357