gem5  v21.1.0.2
StoreTrace.hh
Go to the documentation of this file.
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;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __MEM_RUBY_PROFILER_STORETRACE_HH__
30 #define __MEM_RUBY_PROFILER_STORETRACE_HH__
31 
32 #include <iostream>
33 
34 #include "base/types.hh"
37 
38 namespace gem5
39 {
40 
41 namespace ruby
42 {
43 
45 {
46  public:
47  StoreTrace() { }
48  explicit StoreTrace(Addr addr);
49  ~StoreTrace();
50 
51  void store(NodeID node);
52  void downgrade(NodeID node);
53  int getTotal() const { return m_total_samples; }
54  static void initSummary();
55  static void printSummary(std::ostream& out);
56  static void clearSummary();
57 
58  void print(std::ostream& out) const;
59 
60  private:
61  static bool s_init;
62  static int64_t s_total_samples; // Total number of store lifetimes
63  // of all lines
68 
74 
75  int64_t m_total_samples; // Total number of store lifetimes of this line
80 };
81 
82 inline bool
84 {
85  return n1->getTotal() > n2->getTotal();
86 }
87 
88 inline std::ostream&
89 operator<<(std::ostream& out, const StoreTrace& obj)
90 {
91  obj.print(out);
92  out << std::flush;
93  return out;
94 }
95 
96 } // namespace ruby
97 } // namespace gem5
98 
99 #endif // __MEM_RUBY_PROFILER_STORETRACE_HH__
gem5::ruby::StoreTrace::~StoreTrace
~StoreTrace()
Definition: StoreTrace.cc:61
gem5::ruby::StoreTrace::m_addr
Addr m_addr
Definition: StoreTrace.hh:69
gem5::ruby::StoreTrace::s_store_first_to_stolen_ptr
static Histogram * s_store_first_to_stolen_ptr
Definition: StoreTrace.hh:65
gem5::ruby::StoreTrace
Definition: StoreTrace.hh:44
Histogram.hh
gem5::ruby::operator<<
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition: BoolVec.cc:49
gem5::ruby::StoreTrace::m_last_writer
NodeID m_last_writer
Definition: StoreTrace.hh:70
gem5::ruby::StoreTrace::m_store_last_to_stolen
Histogram m_store_last_to_stolen
Definition: StoreTrace.hh:78
gem5::ruby::StoreTrace::s_total_samples
static int64_t s_total_samples
Definition: StoreTrace.hh:62
gem5::ruby::StoreTrace::print
void print(std::ostream &out) const
Definition: StoreTrace.cc:66
gem5::ruby::StoreTrace::StoreTrace
StoreTrace()
Definition: StoreTrace.hh:47
gem5::ruby::StoreTrace::m_stores_this_interval
int m_stores_this_interval
Definition: StoreTrace.hh:73
gem5::ruby::StoreTrace::clearSummary
static void clearSummary()
Definition: StoreTrace.cc:103
gem5::ruby::StoreTrace::initSummary
static void initSummary()
Definition: StoreTrace.cc:77
gem5::ruby::StoreTrace::getTotal
int getTotal() const
Definition: StoreTrace.hh:53
gem5::ruby::StoreTrace::m_store_count
Histogram m_store_count
Definition: StoreTrace.hh:76
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::ruby::StoreTrace::s_init
static bool s_init
Definition: StoreTrace.hh:61
gem5::ruby::StoreTrace::s_store_count_ptr
static Histogram * s_store_count_ptr
Definition: StoreTrace.hh:64
gem5::ruby::StoreTrace::m_total_samples
int64_t m_total_samples
Definition: StoreTrace.hh:75
gem5::ruby::StoreTrace::m_first_store
Tick m_first_store
Definition: StoreTrace.hh:71
gem5::ruby::StoreTrace::printSummary
static void printSummary(std::ostream &out)
Definition: StoreTrace.cc:90
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::ruby::StoreTrace::m_last_store
Tick m_last_store
Definition: StoreTrace.hh:72
gem5::ruby::StoreTrace::s_store_first_to_last_ptr
static Histogram * s_store_first_to_last_ptr
Definition: StoreTrace.hh:67
gem5::ruby::Histogram
Definition: Histogram.hh:43
gem5::ruby::StoreTrace::downgrade
void downgrade(NodeID node)
Definition: StoreTrace.cc:135
Address.hh
types.hh
gem5::ruby::NodeID
unsigned int NodeID
Definition: TypeDefines.hh:40
gem5::ruby::node_less_then_eq
bool node_less_then_eq(const Histogram *n1, const Histogram *n2)
Definition: Histogram.cc:239
gem5::ruby::StoreTrace::store
void store(NodeID node)
Definition: StoreTrace.cc:114
gem5::ruby::StoreTrace::m_store_first_to_last
Histogram m_store_first_to_last
Definition: StoreTrace.hh:79
gem5::ruby::StoreTrace::m_store_first_to_stolen
Histogram m_store_first_to_stolen
Definition: StoreTrace.hh:77
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::ruby::StoreTrace::s_store_last_to_stolen_ptr
static Histogram * s_store_last_to_stolen_ptr
Definition: StoreTrace.hh:66
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Tue Sep 21 2021 12:25:41 for gem5 by doxygen 1.8.17