gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
38namespace gem5
39{
40
41namespace ruby
42{
43
45{
46 public:
48 explicit StoreTrace(Addr addr);
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
82inline bool
84{
85 return n1->getTotal() > n2->getTotal();
86}
87
88inline std::ostream&
89operator<<(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__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
void store(NodeID node)
static void printSummary(std::ostream &out)
Definition StoreTrace.cc:90
static int64_t s_total_samples
Definition StoreTrace.hh:62
static Histogram * s_store_first_to_stolen_ptr
Definition StoreTrace.hh:65
void downgrade(NodeID node)
Histogram m_store_last_to_stolen
Definition StoreTrace.hh:78
static Histogram * s_store_count_ptr
Definition StoreTrace.hh:64
static void initSummary()
Definition StoreTrace.cc:77
Histogram m_store_first_to_last
Definition StoreTrace.hh:79
static Histogram * s_store_first_to_last_ptr
Definition StoreTrace.hh:67
Histogram m_store_first_to_stolen
Definition StoreTrace.hh:77
void print(std::ostream &out) const
Definition StoreTrace.cc:66
static Histogram * s_store_last_to_stolen_ptr
Definition StoreTrace.hh:66
static void clearSummary()
Bitfield< 3 > addr
Definition types.hh:84
bool node_less_then_eq(const Histogram *n1, const Histogram *n2)
Definition Histogram.cc:239
unsigned int NodeID
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition BoolVec.cc:49
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint64_t Tick
Tick count type.
Definition types.hh:58

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0