gem5
v19.0.0.0
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
a
b
c
d
e
f
i
l
m
o
p
r
s
t
v
x
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
w
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
i
l
m
o
p
r
s
t
v
w
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
cpu
profile.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 The Regents of The University of Michigan
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
* Authors: Nathan Binkert
29
*/
30
31
#ifndef __CPU_PROFILE_HH__
32
#define __CPU_PROFILE_HH__
33
34
#include <map>
35
36
#include "arch/stacktrace.hh"
37
#include "
base/types.hh
"
38
#include "config/the_isa.hh"
39
#include "
cpu/static_inst.hh
"
40
41
class
ThreadContext
;
42
43
class
ProfileNode
44
{
45
private
:
46
friend
class
FunctionProfile
;
47
48
typedef
std::map<Addr, ProfileNode *>
ChildList
;
49
ChildList
children
;
50
51
public
:
52
Counter
count
;
53
54
public
:
55
ProfileNode
();
56
57
void
dump
(
const
std::string &symbol, uint64_t
id
,
58
const
SymbolTable
*
symtab
, std::ostream &
os
)
const
;
59
void
clear
();
60
};
61
62
class
Callback
;
63
class
FunctionProfile
64
{
65
private
:
66
Callback
*
reset
;
67
const
SymbolTable
*
symtab
;
68
ProfileNode
top
;
69
std::map<Addr, Counter>
pc_count
;
70
TheISA::StackTrace
trace
;
71
72
public
:
73
FunctionProfile
(
const
SymbolTable
*symtab);
74
~
FunctionProfile
();
75
76
ProfileNode
*consume(
ThreadContext
*tc,
const
StaticInstPtr
&inst);
77
ProfileNode
*consume(
const
std::vector<Addr>
&
stack
);
78
void
clear
();
79
void
dump
(
ThreadContext
*tc, std::ostream &out)
const
;
80
void
sample(
ProfileNode
*node,
Addr
pc
);
81
};
82
83
inline
ProfileNode
*
84
FunctionProfile::consume
(
ThreadContext
*tc,
const
StaticInstPtr
&inst)
85
{
86
if
(!trace.trace(tc, inst))
87
return
NULL;
88
trace.dprintf();
89
return
consume(trace.getstack());
90
}
91
92
#endif // __CPU_PROFILE_HH__
ProfileNode::count
Counter count
Definition:
profile.hh:52
ProfileNode::ChildList
std::map< Addr, ProfileNode * > ChildList
Definition:
profile.hh:48
Callback
Generic callback class.
Definition:
callback.hh:41
FunctionProfile::pc_count
std::map< Addr, Counter > pc_count
Definition:
profile.hh:69
ProfileNode::children
ChildList children
Definition:
profile.hh:49
FunctionProfile::symtab
const SymbolTable * symtab
Definition:
profile.hh:67
SymbolTable
Definition:
symtab.hh:42
ProfileNode::clear
void clear()
Definition:
profile.cc:80
FunctionProfile
Definition:
profile.hh:63
FunctionProfile::top
ProfileNode top
Definition:
profile.hh:68
RefCountingPtr< StaticInst >
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Definition:
thread_context.hh:93
X86ISA::os
Bitfield< 17 > os
Definition:
misc.hh:805
std::vector< Addr >
ProfileNode::ProfileNode
ProfileNode()
Definition:
profile.cc:45
ProfileNode::FunctionProfile
friend class FunctionProfile
Definition:
profile.hh:46
MipsISA::pc
Bitfield< 4 > pc
Definition:
pra_constants.hh:242
FunctionProfile::trace
TheISA::StackTrace trace
Definition:
profile.hh:70
static_inst.hh
ProfileNode::dump
void dump(const std::string &symbol, uint64_t id, const SymbolTable *symtab, std::ostream &os) const
Definition:
profile.cc:50
types.hh
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:142
FunctionProfile::reset
Callback * reset
Definition:
profile.hh:66
Counter
int64_t Counter
Statistics counter type.
Definition:
types.hh:58
ProfileNode
Definition:
profile.hh:43
X86ISA::stack
Bitfield< 17, 16 > stack
Definition:
misc.hh:589
FunctionProfile::consume
ProfileNode * consume(ThreadContext *tc, const StaticInstPtr &inst)
Definition:
profile.hh:84
Generated on Fri Feb 28 2020 16:27:00 for gem5 by
doxygen
1.8.13