summaryrefslogtreecommitdiff
path: root/src/mem/ruby/profiler/AddressProfiler.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-03-23 22:49:43 -0700
committerNathan Binkert <nate@binkert.org>2010-03-23 22:49:43 -0700
commita2652a048aaba65302d5d191754d873fc94fb226 (patch)
tree1009119d03ff469782ed6a180cbee6ca6bddd2be /src/mem/ruby/profiler/AddressProfiler.hh
parentd2eb58967562d04044a5977787a312e9b259b9b7 (diff)
downloadgem5-a2652a048aaba65302d5d191754d873fc94fb226.tar.xz
ruby: continue style pass
Diffstat (limited to 'src/mem/ruby/profiler/AddressProfiler.hh')
-rw-r--r--src/mem/ruby/profiler/AddressProfiler.hh135
1 files changed, 61 insertions, 74 deletions
diff --git a/src/mem/ruby/profiler/AddressProfiler.hh b/src/mem/ruby/profiler/AddressProfiler.hh
index 177aa56d6..76dac323f 100644
--- a/src/mem/ruby/profiler/AddressProfiler.hh
+++ b/src/mem/ruby/profiler/AddressProfiler.hh
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
@@ -27,89 +26,77 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * AddressProfiler.hh
- *
- * Description:
- *
- * $Id$
- *
- */
-
-#ifndef ADDRESSPROFILER_H
-#define ADDRESSPROFILER_H
+#ifndef __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
+#define __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
+#include "mem/protocol/AccessType.hh"
+#include "mem/protocol/CacheMsg.hh"
+#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/NodeID.hh"
#include "mem/ruby/common/Histogram.hh"
-#include "mem/ruby/common/Address.hh"
-#include "mem/protocol/CacheMsg.hh"
-#include "mem/protocol/AccessType.hh"
+#include "mem/ruby/system/NodeID.hh"
class AccessTraceForAddress;
class Set;
template <class KEY_TYPE, class VALUE_TYPE> class Map;
-class AddressProfiler {
-public:
- // Constructors
- AddressProfiler(int num_of_sequencers);
-
- // Destructor
- ~AddressProfiler();
-
- // Public Methods
- void printStats(ostream& out) const;
- void clearStats();
-
- void addTraceSample(Address data_addr, Address pc_addr, CacheRequestType type, AccessModeType access_mode, NodeID id, bool sharing_miss);
- void profileRetry(const Address& data_addr, AccessType type, int count);
- void profileGetX(const Address& datablock, const Address& PC, const Set& owner, const Set& sharers, NodeID requestor);
- void profileGetS(const Address& datablock, const Address& PC, const Set& owner, const Set& sharers, NodeID requestor);
-
- void print(ostream& out) const;
-
- //added by SS
- void setHotLines(bool hot_lines);
- void setAllInstructions(bool all_instructions);
-private:
- // Private Methods
-
- // Private copy constructor and assignment operator
- AddressProfiler(const AddressProfiler& obj);
- AddressProfiler& operator=(const AddressProfiler& obj);
-
- // Data Members (m_ prefix)
- int64 m_sharing_miss_counter;
-
- Map<Address, AccessTraceForAddress>* m_dataAccessTrace;
- Map<Address, AccessTraceForAddress>* m_macroBlockAccessTrace;
- Map<Address, AccessTraceForAddress>* m_programCounterAccessTrace;
- Map<Address, AccessTraceForAddress>* m_retryProfileMap;
- Histogram m_retryProfileHisto;
- Histogram m_retryProfileHistoWrite;
- Histogram m_retryProfileHistoRead;
- Histogram m_getx_sharing_histogram;
- Histogram m_gets_sharing_histogram;
-//added by SS
- bool m_hot_lines;
- bool m_all_instructions;
-
- int m_num_of_sequencers;
+class AddressProfiler
+{
+ public:
+ typedef Map<Address, AccessTraceForAddress> AddressMap;
+
+ public:
+ AddressProfiler(int num_of_sequencers);
+ ~AddressProfiler();
+
+ void printStats(ostream& out) const;
+ void clearStats();
+
+ void addTraceSample(Address data_addr, Address pc_addr,
+ CacheRequestType type, AccessModeType access_mode,
+ NodeID id, bool sharing_miss);
+ void profileRetry(const Address& data_addr, AccessType type, int count);
+ void profileGetX(const Address& datablock, const Address& PC,
+ const Set& owner, const Set& sharers, NodeID requestor);
+ void profileGetS(const Address& datablock, const Address& PC,
+ const Set& owner, const Set& sharers, NodeID requestor);
+
+ void print(ostream& out) const;
+
+ //added by SS
+ void setHotLines(bool hot_lines);
+ void setAllInstructions(bool all_instructions);
+
+ private:
+ // Private copy constructor and assignment operator
+ AddressProfiler(const AddressProfiler& obj);
+ AddressProfiler& operator=(const AddressProfiler& obj);
+
+ int64 m_sharing_miss_counter;
+
+ AddressMap* m_dataAccessTrace;
+ AddressMap* m_macroBlockAccessTrace;
+ AddressMap* m_programCounterAccessTrace;
+ AddressMap* m_retryProfileMap;
+ Histogram m_retryProfileHisto;
+ Histogram m_retryProfileHistoWrite;
+ Histogram m_retryProfileHistoRead;
+ Histogram m_getx_sharing_histogram;
+ Histogram m_gets_sharing_histogram;
+
+ //added by SS
+ bool m_hot_lines;
+ bool m_all_instructions;
+
+ int m_num_of_sequencers;
};
-// Output operator declaration
-ostream& operator<<(ostream& out, const AddressProfiler& obj);
-
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-ostream& operator<<(ostream& out, const AddressProfiler& obj)
+inline ostream&
+operator<<(ostream& out, const AddressProfiler& obj)
{
- obj.print(out);
- out << flush;
- return out;
+ obj.print(out);
+ out << flush;
+ return out;
}
-#endif //ADDRESSPROFILER_H
+#endif // __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__