Profiler.hh (7048:2ab58c54de63) | Profiler.hh (7055:4e24742201d7) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 31 unchanged lines hidden (view full) --- 40 File modification date: 2008-02-23 41 42 ---------------------------------------------------------------------- 43*/ 44 45#ifndef __MEM_RUBY_PROFILER_PROFILER_HH__ 46#define __MEM_RUBY_PROFILER_PROFILER_HH__ 47 | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 31 unchanged lines hidden (view full) --- 40 File modification date: 2008-02-23 41 42 ---------------------------------------------------------------------- 43*/ 44 45#ifndef __MEM_RUBY_PROFILER_PROFILER_HH__ 46#define __MEM_RUBY_PROFILER_PROFILER_HH__ 47 |
48#include <iostream> 49#include <string> 50 |
|
48#include "mem/protocol/AccessModeType.hh" 49#include "mem/protocol/AccessType.hh" 50#include "mem/protocol/CacheRequestType.hh" 51#include "mem/protocol/GenericMachineType.hh" 52#include "mem/protocol/GenericRequestType.hh" 53#include "mem/protocol/PrefetchBit.hh" 54#include "mem/ruby/common/Address.hh" 55#include "mem/ruby/common/Consumer.hh" --- 16 unchanged lines hidden (view full) --- 72{ 73 public: 74 typedef RubyProfilerParams Params; 75 Profiler(const Params *); 76 ~Profiler(); 77 78 void wakeup(); 79 | 51#include "mem/protocol/AccessModeType.hh" 52#include "mem/protocol/AccessType.hh" 53#include "mem/protocol/CacheRequestType.hh" 54#include "mem/protocol/GenericMachineType.hh" 55#include "mem/protocol/GenericRequestType.hh" 56#include "mem/protocol/PrefetchBit.hh" 57#include "mem/ruby/common/Address.hh" 58#include "mem/ruby/common/Consumer.hh" --- 16 unchanged lines hidden (view full) --- 75{ 76 public: 77 typedef RubyProfilerParams Params; 78 Profiler(const Params *); 79 ~Profiler(); 80 81 void wakeup(); 82 |
80 void setPeriodicStatsFile(const string& filename); | 83 void setPeriodicStatsFile(const std::string& filename); |
81 void setPeriodicStatsInterval(integer_t period); 82 | 84 void setPeriodicStatsInterval(integer_t period); 85 |
83 void printStats(ostream& out, bool short_stats=false); 84 void printShortStats(ostream& out) { printStats(out, true); } 85 void printTraceStats(ostream& out) const; | 86 void printStats(std::ostream& out, bool short_stats=false); 87 void printShortStats(std::ostream& out) { printStats(out, true); } 88 void printTraceStats(std::ostream& out) const; |
86 void clearStats(); | 89 void clearStats(); |
87 void printConfig(ostream& out) const; 88 void printResourceUsage(ostream& out) const; | 90 void printConfig(std::ostream& out) const; 91 void printResourceUsage(std::ostream& out) const; |
89 90 AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; } 91 AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; } 92 93 void addAddressTraceSample(const CacheMsg& msg, NodeID id); 94 | 92 93 AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; } 94 AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; } 95 96 void addAddressTraceSample(const CacheMsg& msg, NodeID id); 97 |
95 void profileRequest(const string& requestStr); | 98 void profileRequest(const std::string& requestStr); |
96 void profileSharing(const Address& addr, AccessType type, 97 NodeID requestor, const Set& sharers, 98 const Set& owner); 99 100 void profileMulticastRetry(const Address& addr, int count); 101 102 void profileFilterAction(int action); 103 --- 25 unchanged lines hidden (view full) --- 129 130 void controllerBusy(MachineID machID); 131 void bankBusy(); 132 void missLatency(Time t, RubyRequestType type); 133 void swPrefetchLatency(Time t, CacheRequestType type, 134 GenericMachineType respondingMach); 135 void sequencerRequests(int num) { m_sequencer_requests.add(num); } 136 | 99 void profileSharing(const Address& addr, AccessType type, 100 NodeID requestor, const Set& sharers, 101 const Set& owner); 102 103 void profileMulticastRetry(const Address& addr, int count); 104 105 void profileFilterAction(int action); 106 --- 25 unchanged lines hidden (view full) --- 132 133 void controllerBusy(MachineID machID); 134 void bankBusy(); 135 void missLatency(Time t, RubyRequestType type); 136 void swPrefetchLatency(Time t, CacheRequestType type, 137 GenericMachineType respondingMach); 138 void sequencerRequests(int num) { m_sequencer_requests.add(num); } 139 |
137 void profileTransition(const string& component, NodeID version, 138 Address addr, const string& state, 139 const string& event, const string& next_state, 140 const string& note); | 140 void profileTransition(const std::string& component, NodeID version, 141 Address addr, const std::string& state, const std::string& event, 142 const std::string& next_state, const std::string& note); |
141 void profileMsgDelay(int virtualNetwork, int delayCycles); 142 | 143 void profileMsgDelay(int virtualNetwork, int delayCycles); 144 |
143 void print(ostream& out) const; | 145 void print(std::ostream& out) const; |
144 145 void rubyWatch(int proc); 146 bool watchAddress(Address addr); 147 148 // return Ruby's start time 149 Time 150 getRubyStartTime() 151 { --- 10 unchanged lines hidden (view full) --- 162 Profiler& operator=(const Profiler& obj); 163 164 AddressProfiler* m_address_profiler_ptr; 165 AddressProfiler* m_inst_profiler_ptr; 166 167 Vector<int64> m_instructions_executed_at_start; 168 Vector<int64> m_cycles_executed_at_start; 169 | 146 147 void rubyWatch(int proc); 148 bool watchAddress(Address addr); 149 150 // return Ruby's start time 151 Time 152 getRubyStartTime() 153 { --- 10 unchanged lines hidden (view full) --- 164 Profiler& operator=(const Profiler& obj); 165 166 AddressProfiler* m_address_profiler_ptr; 167 AddressProfiler* m_inst_profiler_ptr; 168 169 Vector<int64> m_instructions_executed_at_start; 170 Vector<int64> m_cycles_executed_at_start; 171 |
170 ostream* m_periodic_output_file_ptr; | 172 std::ostream* m_periodic_output_file_ptr; |
171 integer_t m_stats_period; 172 173 Time m_ruby_start; 174 time_t m_real_time_start_time; 175 176 Vector <Vector<integer_t> > m_busyControllerCount; 177 integer_t m_busyBankCount; 178 Histogram m_multicast_retry_histogram; --- 26 unchanged lines hidden (view full) --- 205 Histogram m_outstanding_requests; 206 Histogram m_outstanding_persistent_requests; 207 208 Histogram m_average_latency_estimate; 209 210 Map<Address, int>* m_watch_address_list_ptr; 211 // counts all initiated cache request including PUTs 212 int m_requests; | 173 integer_t m_stats_period; 174 175 Time m_ruby_start; 176 time_t m_real_time_start_time; 177 178 Vector <Vector<integer_t> > m_busyControllerCount; 179 integer_t m_busyBankCount; 180 Histogram m_multicast_retry_histogram; --- 26 unchanged lines hidden (view full) --- 207 Histogram m_outstanding_requests; 208 Histogram m_outstanding_persistent_requests; 209 210 Histogram m_average_latency_estimate; 211 212 Map<Address, int>* m_watch_address_list_ptr; 213 // counts all initiated cache request including PUTs 214 int m_requests; |
213 Map | 215 Map <std::string, int>* m_requestProfileMap_ptr; |
214 215 //added by SS 216 bool m_hot_lines; 217 bool m_all_instructions; 218 219 int m_num_of_sequencers; 220}; 221 | 216 217 //added by SS 218 bool m_hot_lines; 219 bool m_all_instructions; 220 221 int m_num_of_sequencers; 222}; 223 |
222inline ostream& 223operator<<(ostream& out, const Profiler& obj) | 224inline std::ostream& 225operator<<(std::ostream& out, const Profiler& obj) |
224{ 225 obj.print(out); | 226{ 227 obj.print(out); |
226 out << flush; | 228 out << std::flush; |
227 return out; 228} 229 230#endif // __MEM_RUBY_PROFILER_PROFILER_HH__ 231 232 | 229 return out; 230} 231 232#endif // __MEM_RUBY_PROFILER_PROFILER_HH__ 233 234 |