From 140785d24c27f3afddbe95c9e504e27bf8274290 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 10 Mar 2010 18:33:11 -0800 Subject: ruby: get rid of std-includes.hh Do not use "using namespace std;" in headers Include header files as needed --- src/mem/ruby/profiler/CacheProfiler.hh | 17 ++++++++++------- src/mem/ruby/profiler/MemCntrlProfiler.cc | 2 ++ src/mem/ruby/profiler/MemCntrlProfiler.hh | 17 ++++++++++------- src/mem/ruby/profiler/Profiler.cc | 7 ++++--- 4 files changed, 26 insertions(+), 17 deletions(-) (limited to 'src/mem/ruby/profiler') diff --git a/src/mem/ruby/profiler/CacheProfiler.hh b/src/mem/ruby/profiler/CacheProfiler.hh index 6c5fbb988..11f189148 100644 --- a/src/mem/ruby/profiler/CacheProfiler.hh +++ b/src/mem/ruby/profiler/CacheProfiler.hh @@ -39,6 +39,9 @@ #ifndef CACHEPROFILER_H #define CACHEPROFILER_H +#include +#include + #include "mem/ruby/common/Global.hh" #include "mem/ruby/system/NodeID.hh" #include "mem/ruby/common/Histogram.hh" @@ -51,18 +54,18 @@ template class Vector; class CacheProfiler { public: // Constructors - CacheProfiler(const string& description); + CacheProfiler(const std::string& description); // Destructor ~CacheProfiler(); // Public Methods - void printStats(ostream& out) const; + void printStats(std::ostream& out) const; void clearStats(); void addStatSample(CacheRequestType requestType, AccessModeType type, int msgSize, PrefetchBit pfBit); - void print(ostream& out) const; + void print(std::ostream& out) const; private: // Private Methods @@ -71,7 +74,7 @@ private: CacheProfiler& operator=(const CacheProfiler& obj); // Data Members (m_ prefix) - string m_description; + std::string m_description; Histogram m_requestSize; int64 m_misses; int64 m_demand_misses; @@ -84,16 +87,16 @@ private: }; // Output operator declaration -ostream& operator<<(ostream& out, const CacheProfiler& obj); +std::ostream& operator<<(std::ostream& out, const CacheProfiler& obj); // ******************* Definitions ******************* // Output operator definition extern inline -ostream& operator<<(ostream& out, const CacheProfiler& obj) +std::ostream& operator<<(std::ostream& out, const CacheProfiler& obj) { obj.print(out); - out << flush; + out << std::flush; return out; } diff --git a/src/mem/ruby/profiler/MemCntrlProfiler.cc b/src/mem/ruby/profiler/MemCntrlProfiler.cc index 693d43dc7..b41d7de78 100644 --- a/src/mem/ruby/profiler/MemCntrlProfiler.cc +++ b/src/mem/ruby/profiler/MemCntrlProfiler.cc @@ -29,6 +29,8 @@ #include "mem/ruby/profiler/MemCntrlProfiler.hh" +using namespace std; + MemCntrlProfiler::MemCntrlProfiler(const string& description, int banks_per_rank, int ranks_per_dimm, diff --git a/src/mem/ruby/profiler/MemCntrlProfiler.hh b/src/mem/ruby/profiler/MemCntrlProfiler.hh index 5343fac1b..ebedd5185 100644 --- a/src/mem/ruby/profiler/MemCntrlProfiler.hh +++ b/src/mem/ruby/profiler/MemCntrlProfiler.hh @@ -39,6 +39,9 @@ #ifndef MEM_CNTRL_PROFILER_H #define MEM_CNTRL_PROFILER_H +#include +#include + #include "mem/gems_common/Vector.hh" #include "mem/ruby/common/Global.hh" @@ -47,7 +50,7 @@ template class Vector; class MemCntrlProfiler { public: // Constructors - MemCntrlProfiler(const string& description, + MemCntrlProfiler(const std::string& description, int banks_per_rank, int ranks_per_dimm, int dimms_per_channel); @@ -56,7 +59,7 @@ public: ~MemCntrlProfiler(); // Public Methods - void printStats(ostream& out) const; + void printStats(std::ostream& out) const; void clearStats(); void profileMemReq(int bank); @@ -75,7 +78,7 @@ public: void profileMemRandBusy(); void profileMemNotOld(); - void print(ostream& out) const; + void print(std::ostream& out) const; private: // Private Methods @@ -84,7 +87,7 @@ private: MemCntrlProfiler& operator=(const MemCntrlProfiler& obj); // Data Members (m_ prefix) - string m_description; + std::string m_description; uint64 m_memReq; uint64 m_memBankBusy; uint64 m_memBusBusy; @@ -107,16 +110,16 @@ private: }; // Output operator declaration -ostream& operator<<(ostream& out, const MemCntrlProfiler& obj); +std::ostream& operator<<(std::ostream& out, const MemCntrlProfiler& obj); // ******************* Definitions ******************* // Output operator definition extern inline -ostream& operator<<(ostream& out, const MemCntrlProfiler& obj) +std::ostream& operator<<(std::ostream& out, const MemCntrlProfiler& obj) { obj.print(out); - out << flush; + out << std::flush; return out; } diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc index f09b93216..33425371f 100644 --- a/src/mem/ruby/profiler/Profiler.cc +++ b/src/mem/ruby/profiler/Profiler.cc @@ -51,6 +51,10 @@ * */ +// Allows use of times() library call, which determines virtual runtime +#include +#include + #include "mem/ruby/profiler/Profiler.hh" #include "mem/ruby/profiler/AddressProfiler.hh" #include "mem/ruby/system/System.hh" @@ -65,9 +69,6 @@ #include "mem/ruby/system/System.hh" -// Allows use of times() library call, which determines virtual runtime -#include - extern std::ostream * debug_cout_ptr; static double process_memory_total(); -- cgit v1.2.3