summaryrefslogtreecommitdiff
path: root/src/mem/ruby/profiler
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-04-02 11:20:32 -0700
committerNathan Binkert <nate@binkert.org>2010-04-02 11:20:32 -0700
commitf1c3f3044b73d890ffdfdd113b3b37ae2809d21b (patch)
tree959d71e897a8d01868c8dea8a8b225cbd1b5ce2c /src/mem/ruby/profiler
parentbe10204729c107b41d5d7487323c732e9fa09df5 (diff)
downloadgem5-f1c3f3044b73d890ffdfdd113b3b37ae2809d21b.tar.xz
ruby: get "using namespace" out of headers
In addition to obvious changes, this required a slight change to the slicc grammar to allow types with :: in them. Otherwise slicc barfs on std::string which we need for the headers that slicc generates.
Diffstat (limited to 'src/mem/ruby/profiler')
-rw-r--r--src/mem/ruby/profiler/AccessTraceForAddress.cc2
-rw-r--r--src/mem/ruby/profiler/AccessTraceForAddress.hh10
-rw-r--r--src/mem/ruby/profiler/AddressProfiler.cc1
-rw-r--r--src/mem/ruby/profiler/AddressProfiler.hh12
-rw-r--r--src/mem/ruby/profiler/CacheProfiler.cc2
-rw-r--r--src/mem/ruby/profiler/Profiler.cc4
-rw-r--r--src/mem/ruby/profiler/Profiler.hh36
-rw-r--r--src/mem/ruby/profiler/StoreTrace.cc2
-rw-r--r--src/mem/ruby/profiler/StoreTrace.hh12
9 files changed, 48 insertions, 33 deletions
diff --git a/src/mem/ruby/profiler/AccessTraceForAddress.cc b/src/mem/ruby/profiler/AccessTraceForAddress.cc
index 978b72982..79661ed18 100644
--- a/src/mem/ruby/profiler/AccessTraceForAddress.cc
+++ b/src/mem/ruby/profiler/AccessTraceForAddress.cc
@@ -55,7 +55,7 @@ AccessTraceForAddress::~AccessTraceForAddress()
}
void
-AccessTraceForAddress::print(ostream& out) const
+AccessTraceForAddress::print(std::ostream& out) const
{
out << m_addr;
diff --git a/src/mem/ruby/profiler/AccessTraceForAddress.hh b/src/mem/ruby/profiler/AccessTraceForAddress.hh
index 53b96856e..7ca875f3f 100644
--- a/src/mem/ruby/profiler/AccessTraceForAddress.hh
+++ b/src/mem/ruby/profiler/AccessTraceForAddress.hh
@@ -29,6 +29,8 @@
#ifndef __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
#define __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
+#include <iostream>
+
#include "mem/protocol/AccessModeType.hh"
#include "mem/protocol/CacheRequestType.hh"
#include "mem/ruby/common/Address.hh"
@@ -53,7 +55,7 @@ class AccessTraceForAddress
const Address& getAddress() const { return m_addr; }
void addSample(int value);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
Address m_addr;
@@ -74,11 +76,11 @@ node_less_then_eq(const AccessTraceForAddress* n1,
return n1->getTotal() > n2->getTotal();
}
-inline ostream&
-operator<<(ostream& out, const AccessTraceForAddress& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AccessTraceForAddress& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/profiler/AddressProfiler.cc b/src/mem/ruby/profiler/AddressProfiler.cc
index cebf22fd8..d11e74b01 100644
--- a/src/mem/ruby/profiler/AddressProfiler.cc
+++ b/src/mem/ruby/profiler/AddressProfiler.cc
@@ -34,6 +34,7 @@
#include "mem/ruby/profiler/Profiler.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
typedef AddressProfiler::AddressMap AddressMap;
// Helper functions
diff --git a/src/mem/ruby/profiler/AddressProfiler.hh b/src/mem/ruby/profiler/AddressProfiler.hh
index 76dac323f..dd6cea52b 100644
--- a/src/mem/ruby/profiler/AddressProfiler.hh
+++ b/src/mem/ruby/profiler/AddressProfiler.hh
@@ -29,6 +29,8 @@
#ifndef __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
#define __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
+#include <iostream>
+
#include "mem/protocol/AccessType.hh"
#include "mem/protocol/CacheMsg.hh"
#include "mem/ruby/common/Address.hh"
@@ -49,7 +51,7 @@ class AddressProfiler
AddressProfiler(int num_of_sequencers);
~AddressProfiler();
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
void addTraceSample(Address data_addr, Address pc_addr,
@@ -61,7 +63,7 @@ class AddressProfiler
void profileGetS(const Address& datablock, const Address& PC,
const Set& owner, const Set& sharers, NodeID requestor);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
//added by SS
void setHotLines(bool hot_lines);
@@ -91,11 +93,11 @@ class AddressProfiler
int m_num_of_sequencers;
};
-inline ostream&
-operator<<(ostream& out, const AddressProfiler& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AddressProfiler& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/profiler/CacheProfiler.cc b/src/mem/ruby/profiler/CacheProfiler.cc
index 9d12a46ab..f359314c1 100644
--- a/src/mem/ruby/profiler/CacheProfiler.cc
+++ b/src/mem/ruby/profiler/CacheProfiler.cc
@@ -33,6 +33,8 @@
#include "mem/ruby/profiler/Profiler.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
CacheProfiler::CacheProfiler(const string& description)
{
m_description = description;
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index 559c16900..fc67f0052 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -59,7 +59,9 @@
#include "mem/ruby/system/System.hh"
#include "mem/ruby/system/System.hh"
-extern std::ostream* debug_cout_ptr;
+using namespace std;
+
+extern ostream* debug_cout_ptr;
static double process_memory_total();
static double process_memory_resident();
diff --git a/src/mem/ruby/profiler/Profiler.hh b/src/mem/ruby/profiler/Profiler.hh
index bf4bf8a50..bb2187488 100644
--- a/src/mem/ruby/profiler/Profiler.hh
+++ b/src/mem/ruby/profiler/Profiler.hh
@@ -45,6 +45,9 @@
#ifndef __MEM_RUBY_PROFILER_PROFILER_HH__
#define __MEM_RUBY_PROFILER_PROFILER_HH__
+#include <iostream>
+#include <string>
+
#include "mem/protocol/AccessModeType.hh"
#include "mem/protocol/AccessType.hh"
#include "mem/protocol/CacheRequestType.hh"
@@ -77,22 +80,22 @@ class Profiler : public SimObject, public Consumer
void wakeup();
- void setPeriodicStatsFile(const string& filename);
+ void setPeriodicStatsFile(const std::string& filename);
void setPeriodicStatsInterval(integer_t period);
- void printStats(ostream& out, bool short_stats=false);
- void printShortStats(ostream& out) { printStats(out, true); }
- void printTraceStats(ostream& out) const;
+ void printStats(std::ostream& out, bool short_stats=false);
+ void printShortStats(std::ostream& out) { printStats(out, true); }
+ void printTraceStats(std::ostream& out) const;
void clearStats();
- void printConfig(ostream& out) const;
- void printResourceUsage(ostream& out) const;
+ void printConfig(std::ostream& out) const;
+ void printResourceUsage(std::ostream& out) const;
AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; }
AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; }
void addAddressTraceSample(const CacheMsg& msg, NodeID id);
- void profileRequest(const string& requestStr);
+ void profileRequest(const std::string& requestStr);
void profileSharing(const Address& addr, AccessType type,
NodeID requestor, const Set& sharers,
const Set& owner);
@@ -134,13 +137,12 @@ class Profiler : public SimObject, public Consumer
GenericMachineType respondingMach);
void sequencerRequests(int num) { m_sequencer_requests.add(num); }
- void profileTransition(const string& component, NodeID version,
- Address addr, const string& state,
- const string& event, const string& next_state,
- const string& note);
+ void profileTransition(const std::string& component, NodeID version,
+ Address addr, const std::string& state, const std::string& event,
+ const std::string& next_state, const std::string& note);
void profileMsgDelay(int virtualNetwork, int delayCycles);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
void rubyWatch(int proc);
bool watchAddress(Address addr);
@@ -167,7 +169,7 @@ class Profiler : public SimObject, public Consumer
Vector<int64> m_instructions_executed_at_start;
Vector<int64> m_cycles_executed_at_start;
- ostream* m_periodic_output_file_ptr;
+ std::ostream* m_periodic_output_file_ptr;
integer_t m_stats_period;
Time m_ruby_start;
@@ -210,7 +212,7 @@ class Profiler : public SimObject, public Consumer
Map<Address, int>* m_watch_address_list_ptr;
// counts all initiated cache request including PUTs
int m_requests;
- Map <string, int>* m_requestProfileMap_ptr;
+ Map <std::string, int>* m_requestProfileMap_ptr;
//added by SS
bool m_hot_lines;
@@ -219,11 +221,11 @@ class Profiler : public SimObject, public Consumer
int m_num_of_sequencers;
};
-inline ostream&
-operator<<(ostream& out, const Profiler& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Profiler& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/profiler/StoreTrace.cc b/src/mem/ruby/profiler/StoreTrace.cc
index ce42560b6..bcd90ab9d 100644
--- a/src/mem/ruby/profiler/StoreTrace.cc
+++ b/src/mem/ruby/profiler/StoreTrace.cc
@@ -29,6 +29,8 @@
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
#include "mem/ruby/profiler/StoreTrace.hh"
+using namespace std;
+
bool StoreTrace::s_init = false; // Total number of store lifetimes of
// all lines
int64 StoreTrace::s_total_samples = 0; // Total number of store
diff --git a/src/mem/ruby/profiler/StoreTrace.hh b/src/mem/ruby/profiler/StoreTrace.hh
index 8bddfe6c7..9c0945c15 100644
--- a/src/mem/ruby/profiler/StoreTrace.hh
+++ b/src/mem/ruby/profiler/StoreTrace.hh
@@ -29,6 +29,8 @@
#ifndef __MEM_RUBY_PROFILER_STORETRACE_HH__
#define __MEM_RUBY_PROFILER_STORETRACE_HH__
+#include <iostream>
+
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/common/Histogram.hh"
@@ -44,10 +46,10 @@ class StoreTrace
void downgrade(NodeID node);
int getTotal() const { return m_total_samples; }
static void initSummary();
- static void printSummary(ostream& out);
+ static void printSummary(std::ostream& out);
static void clearSummary();
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
static bool s_init;
@@ -77,11 +79,11 @@ node_less_then_eq(const StoreTrace* n1, const StoreTrace* n2)
return n1->getTotal() > n2->getTotal();
}
-inline ostream&
-operator<<(ostream& out, const StoreTrace& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const StoreTrace& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}