45,52c45,46
< /*
< * Profiler.hh
< *
< * Description:
< *
< * $Id$
< *
< */
---
> #ifndef __MEM_RUBY_PROFILER_PROFILER_HH__
> #define __MEM_RUBY_PROFILER_PROFILER_HH__
54,62d47
< #ifndef PROFILER_H
< #define PROFILER_H
<
< #include "mem/ruby/libruby.hh"
<
< #include "mem/ruby/common/Global.hh"
< #include "mem/protocol/GenericMachineType.hh"
< #include "mem/ruby/common/Histogram.hh"
< #include "mem/ruby/common/Consumer.hh"
65,66c50,52
< #include "mem/ruby/system/NodeID.hh"
< #include "mem/ruby/system/MachineID.hh"
---
> #include "mem/protocol/CacheRequestType.hh"
> #include "mem/protocol/GenericMachineType.hh"
> #include "mem/protocol/GenericRequestType.hh"
68a55,57
> #include "mem/ruby/common/Consumer.hh"
> #include "mem/ruby/common/Global.hh"
> #include "mem/ruby/common/Histogram.hh"
70,71c59,60
< #include "mem/protocol/CacheRequestType.hh"
< #include "mem/protocol/GenericRequestType.hh"
---
> #include "mem/ruby/libruby.hh"
> #include "mem/ruby/system/MachineID.hh"
73c62
<
---
> #include "mem/ruby/system/NodeID.hh"
82,84c71,73
< class Profiler : public SimObject, public Consumer {
< public:
< // Constructors
---
> class Profiler : public SimObject, public Consumer
> {
> public:
86c75,76
< Profiler(const Params *);
---
> Profiler(const Params *);
> ~Profiler();
88,89c78
< // Destructor
< ~Profiler();
---
> void wakeup();
91,92c80,81
< // Public Methods
< void wakeup();
---
> void setPeriodicStatsFile(const string& filename);
> void setPeriodicStatsInterval(integer_t period);
94,95c83,88
< void setPeriodicStatsFile(const 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 clearStats();
> void printConfig(ostream& out) const;
> void printResourceUsage(ostream& out) const;
97,102c90,91
< void printStats(ostream& out, bool short_stats=false);
< void printShortStats(ostream& out) { printStats(out, true); }
< void printTraceStats(ostream& out) const;
< void clearStats();
< void printConfig(ostream& out) const;
< void printResourceUsage(ostream& out) const;
---
> AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; }
> AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; }
104,105c93
< AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; }
< AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; }
---
> void addAddressTraceSample(const CacheMsg& msg, NodeID id);
107c95,98
< void addAddressTraceSample(const CacheMsg& msg, NodeID id);
---
> void profileRequest(const string& requestStr);
> void profileSharing(const Address& addr, AccessType type,
> NodeID requestor, const Set& sharers,
> const Set& owner);
109,110c100
< void profileRequest(const string& requestStr);
< void profileSharing(const Address& addr, AccessType type, NodeID requestor, const Set& sharers, const Set& owner);
---
> void profileMulticastRetry(const Address& addr, int count);
112c102
< void profileMulticastRetry(const Address& addr, int count);
---
> void profileFilterAction(int action);
114c104
< void profileFilterAction(int action);
---
> void profileConflictingRequests(const Address& addr);
116,119c106,110
< void profileConflictingRequests(const Address& addr);
< void profileOutstandingRequest(int outstanding) { m_outstanding_requests.add(outstanding); }
< void profileOutstandingPersistentRequest(int outstanding) { m_outstanding_persistent_requests.add(outstanding); }
< void profileAverageLatencyEstimate(int latency) { m_average_latency_estimate.add(latency); }
---
> void
> profileOutstandingRequest(int outstanding)
> {
> m_outstanding_requests.add(outstanding);
> }
121c112,116
< void recordPrediction(bool wasGood, bool wasPredicted);
---
> void
> profileOutstandingPersistentRequest(int outstanding)
> {
> m_outstanding_persistent_requests.add(outstanding);
> }
123,125c118,122
< void startTransaction(int cpu);
< void endTransaction(int cpu);
< void profilePFWait(Time waitTime);
---
> void
> profileAverageLatencyEstimate(int latency)
> {
> m_average_latency_estimate.add(latency);
> }
127,131c124
< void controllerBusy(MachineID machID);
< void bankBusy();
< void missLatency(Time t, RubyRequestType type);
< void swPrefetchLatency(Time t, CacheRequestType type, GenericMachineType respondingMach);
< void sequencerRequests(int num) { m_sequencer_requests.add(num); }
---
> void recordPrediction(bool wasGood, bool wasPredicted);
133,136c126,128
< void profileTransition(const string& component, NodeID version, Address addr,
< const string& state, const string& event,
< const string& next_state, const string& note);
< void profileMsgDelay(int virtualNetwork, int delayCycles);
---
> void startTransaction(int cpu);
> void endTransaction(int cpu);
> void profilePFWait(Time waitTime);
138c130,135
< void print(ostream& out) const;
---
> void controllerBusy(MachineID machID);
> void bankBusy();
> void missLatency(Time t, RubyRequestType type);
> void swPrefetchLatency(Time t, CacheRequestType type,
> GenericMachineType respondingMach);
> void sequencerRequests(int num) { m_sequencer_requests.add(num); }
140,141c137,141
< void rubyWatch(int proc);
< bool watchAddress(Address addr);
---
> void profileTransition(const string& component, NodeID version,
> Address addr, const string& state,
> const string& event, const string& next_state,
> const string& note);
> void profileMsgDelay(int virtualNetwork, int delayCycles);
143,146c143
< // return Ruby's start time
< Time getRubyStartTime(){
< return m_ruby_start;
< }
---
> void print(ostream& out) const;
148,150c145,146
< //added by SS
< bool getHotLines() { return m_hot_lines; }
< bool getAllInstructions() { return m_all_instructions; }
---
> void rubyWatch(int proc);
> bool watchAddress(Address addr);
152c148,153
< private:
---
> // return Ruby's start time
> Time
> getRubyStartTime()
> {
> return m_ruby_start;
> }
154,156c155,157
< // Private copy constructor and assignment operator
< Profiler(const Profiler& obj);
< Profiler& operator=(const Profiler& obj);
---
> // added by SS
> bool getHotLines() { return m_hot_lines; }
> bool getAllInstructions() { return m_all_instructions; }
158,160c159,162
< // Data Members (m_ prefix)
< AddressProfiler* m_address_profiler_ptr;
< AddressProfiler* m_inst_profiler_ptr;
---
> private:
> // Private copy constructor and assignment operator
> Profiler(const Profiler& obj);
> Profiler& operator=(const Profiler& obj);
162,163c164,165
< Vector<int64> m_instructions_executed_at_start;
< Vector<int64> m_cycles_executed_at_start;
---
> AddressProfiler* m_address_profiler_ptr;
> AddressProfiler* m_inst_profiler_ptr;
165,166c167,168
< ostream* m_periodic_output_file_ptr;
< integer_t m_stats_period;
---
> Vector<int64> m_instructions_executed_at_start;
> Vector<int64> m_cycles_executed_at_start;
168,169c170,171
< Time m_ruby_start;
< time_t m_real_time_start_time;
---
> ostream* m_periodic_output_file_ptr;
> integer_t m_stats_period;
171,173c173,174
< Vector < Vector < integer_t > > m_busyControllerCount;
< integer_t m_busyBankCount;
< Histogram m_multicast_retry_histogram;
---
> Time m_ruby_start;
> time_t m_real_time_start_time;
175,176c176,178
< Histogram m_filter_action_histogram;
< Histogram m_tbeProfile;
---
> Vector <Vector<integer_t> > m_busyControllerCount;
> integer_t m_busyBankCount;
> Histogram m_multicast_retry_histogram;
178,183c180,181
< Histogram m_sequencer_requests;
< Histogram m_read_sharing_histogram;
< Histogram m_write_sharing_histogram;
< Histogram m_all_sharing_histogram;
< int64 m_cache_to_cache;
< int64 m_memory_to_cache;
---
> Histogram m_filter_action_histogram;
> Histogram m_tbeProfile;
185c183,188
< Histogram m_prefetchWaitHistogram;
---
> Histogram m_sequencer_requests;
> Histogram m_read_sharing_histogram;
> Histogram m_write_sharing_histogram;
> Histogram m_all_sharing_histogram;
> int64 m_cache_to_cache;
> int64 m_memory_to_cache;
187,189c190
< Vector<Histogram> m_missLatencyHistograms;
< Vector<Histogram> m_machLatencyHistograms;
< Histogram m_allMissLatencyHistogram;
---
> Histogram m_prefetchWaitHistogram;
191,194c192,194
< Histogram m_allSWPrefetchLatencyHistogram;
< Histogram m_SWPrefetchL2MissLatencyHistogram;
< Vector<Histogram> m_SWPrefetchLatencyHistograms;
< Vector<Histogram> m_SWPrefetchMachLatencyHistograms;
---
> Vector<Histogram> m_missLatencyHistograms;
> Vector<Histogram> m_machLatencyHistograms;
> Histogram m_allMissLatencyHistogram;
196,198c196,199
< Histogram m_delayedCyclesHistogram;
< Histogram m_delayedCyclesNonPFHistogram;
< Vector<Histogram> m_delayedCyclesVCHistograms;
---
> Histogram m_allSWPrefetchLatencyHistogram;
> Histogram m_SWPrefetchL2MissLatencyHistogram;
> Vector<Histogram> m_SWPrefetchLatencyHistograms;
> Vector<Histogram> m_SWPrefetchMachLatencyHistograms;
200,201c201,203
< Histogram m_outstanding_requests;
< Histogram m_outstanding_persistent_requests;
---
> Histogram m_delayedCyclesHistogram;
> Histogram m_delayedCyclesNonPFHistogram;
> Vector<Histogram> m_delayedCyclesVCHistograms;
203c205,206
< Histogram m_average_latency_estimate;
---
> Histogram m_outstanding_requests;
> Histogram m_outstanding_persistent_requests;
205,208c208
< Map<Address, int>* m_watch_address_list_ptr;
< // counts all initiated cache request including PUTs
< int m_requests;
< Map <string, int>* m_requestProfileMap_ptr;
---
> Histogram m_average_latency_estimate;
210,212c210,213
< //added by SS
< bool m_hot_lines;
< bool m_all_instructions;
---
> Map<Address, int>* m_watch_address_list_ptr;
> // counts all initiated cache request including PUTs
> int m_requests;
> Map <string, int>* m_requestProfileMap_ptr;
214c215,219
< int m_num_of_sequencers;
---
> //added by SS
> bool m_hot_lines;
> bool m_all_instructions;
>
> int m_num_of_sequencers;
217,224c222,223
< // Output operator declaration
< ostream& operator<<(ostream& out, const Profiler& obj);
<
< // ******************* Definitions *******************
<
< // Output operator definition
< extern inline
< ostream& operator<<(ostream& out, const Profiler& obj)
---
> inline ostream&
> operator<<(ostream& out, const Profiler& obj)
226,228c225,227
< obj.print(out);
< out << flush;
< return out;
---
> obj.print(out);
> out << flush;
> return out;
231c230
< #endif //PROFILER_H
---
> #endif // __MEM_RUBY_PROFILER_PROFILER_HH__