gem5
v19.0.0.0
arch
alpha
kernel_stats.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2004-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: Lisa Hsu
29
* Nathan Binkert
30
*/
31
32
#ifndef __ARCH_ALPHA_KERNEL_STATS_HH__
33
#define __ARCH_ALPHA_KERNEL_STATS_HH__
34
35
#include <map>
36
#include <stack>
37
#include <string>
38
#include <vector>
39
40
#include "
cpu/static_inst.hh
"
41
#include "
kern/kernel_stats.hh
"
42
43
class
ThreadContext
;
44
45
namespace
AlphaISA
{
46
namespace
Kernel
{
47
48
enum
cpu_mode
{
kernel
,
user
,
idle
,
cpu_mode_num
};
49
extern
const
char
*
modestr
[];
50
51
class
Statistics
:
public
::Kernel::Statistics
52
{
53
protected
:
54
Addr
idleProcess
;
55
cpu_mode
themode
;
56
Tick
lastModeTick
;
57
58
void
changeMode
(
cpu_mode
newmode,
ThreadContext
*tc);
59
60
private
:
61
Stats::Vector
_callpal
;
62
63
Stats::Scalar
_hwrei
;
64
65
Stats::Vector
_mode
;
66
Stats::Vector
_modeGood
;
67
Stats::Formula
_modeFraction
;
68
Stats::Vector
_modeTicks
;
69
70
Stats::Scalar
_swap_context
;
71
72
Stats::Vector
_iplCount
;
73
Stats::Vector
_iplGood
;
74
Stats::Vector
_iplTicks
;
75
Stats::Formula
_iplUsed
;
76
77
private
:
78
int
iplLast
;
79
Tick
iplLastTick
;
80
81
public
:
82
Statistics
();
83
84
void
regStats
(
const
std::string &
name
)
override
;
85
86
public
:
87
void
mode
(
cpu_mode
newmode,
ThreadContext
*tc);
88
void
context
(
Addr
oldpcbb,
Addr
newpcbb,
ThreadContext
*tc);
89
void
callpal
(
int
code,
ThreadContext
*tc);
90
void
hwrei
() { _hwrei++; }
91
void
swpipl
(
int
ipl
);
92
93
void
setIdleProcess
(
Addr
idle
,
ThreadContext
*tc);
94
95
public
:
96
void
serialize
(
CheckpointOut
&
cp
)
const override
;
97
void
unserialize
(
CheckpointIn
&cp)
override
;
98
};
99
100
}
// namespace Kernel
101
}
// namespace AlphaISA
102
103
#endif // __ARCH_ALPHA_KERNEL_STATS_HH__
AlphaISA::Kernel::Statistics::_iplTicks
Stats::Vector _iplTicks
Definition:
kernel_stats.hh:74
AlphaISA::Kernel::Statistics::mode
void mode(cpu_mode newmode, ThreadContext *tc)
Definition:
kernel_stats.cc:184
AlphaISA::Kernel::Statistics::_iplUsed
Stats::Formula _iplUsed
Definition:
kernel_stats.hh:75
AlphaISA::Kernel::cpu_mode
cpu_mode
Definition:
kernel_stats.hh:48
AlphaISA::Kernel::Statistics::regStats
void regStats(const std::string &name) override
AlphaISA::Kernel::idle
Definition:
kernel_stats.hh:48
Stats::Vector
A vector of scalar stats.
Definition:
statistics.hh:2550
cp
Definition:
cprintf.cc:42
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Definition:
thread_context.hh:93
Stats::Scalar
This is a simple scalar statistic, like a counter.
Definition:
statistics.hh:2508
AlphaISA::Kernel::Statistics::changeMode
void changeMode(cpu_mode newmode, ThreadContext *tc)
Definition:
kernel_stats.cc:165
AlphaISA::Kernel::Statistics::hwrei
void hwrei()
Definition:
kernel_stats.hh:90
AlphaISA::Kernel::Statistics::context
void context(Addr oldpcbb, Addr newpcbb, ThreadContext *tc)
Definition:
kernel_stats.cc:195
AlphaISA::Kernel::modestr
const char * modestr[]
Definition:
kernel_stats.cc:51
AlphaISA::Kernel::Statistics::_modeGood
Stats::Vector _modeGood
Definition:
kernel_stats.hh:66
AlphaISA::Kernel::Statistics::lastModeTick
Tick lastModeTick
Definition:
kernel_stats.hh:56
AlphaISA::Kernel::Statistics::iplLast
int iplLast
Definition:
kernel_stats.hh:78
AlphaISA::Kernel::Statistics::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition:
kernel_stats.cc:245
AlphaISA::Kernel::Statistics::_iplCount
Stats::Vector _iplCount
Definition:
kernel_stats.hh:72
static_inst.hh
Tick
uint64_t Tick
Tick count type.
Definition:
types.hh:63
AlphaISA::Kernel::Statistics::_iplGood
Stats::Vector _iplGood
Definition:
kernel_stats.hh:73
AlphaISA::Kernel::Statistics::swpipl
void swpipl(int ipl)
Definition:
kernel_stats.cc:217
AlphaISA::Kernel::Statistics::_modeFraction
Stats::Formula _modeFraction
Definition:
kernel_stats.hh:67
AlphaISA::Kernel::Statistics::callpal
void callpal(int code, ThreadContext *tc)
Definition:
kernel_stats.cc:208
AlphaISA::Kernel::Statistics::_mode
Stats::Vector _mode
Definition:
kernel_stats.hh:65
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:142
CheckpointIn
Definition:
serialize.hh:72
AlphaISA::Kernel::Statistics::idleProcess
Addr idleProcess
Definition:
kernel_stats.hh:54
AlphaISA::Kernel::cpu_mode_num
Definition:
kernel_stats.hh:48
AlphaISA::Kernel::Statistics::_swap_context
Stats::Scalar _swap_context
Definition:
kernel_stats.hh:70
Stats::Formula
A formula for statistics that is calculated when printed.
Definition:
statistics.hh:3012
AlphaISA::Kernel::Statistics::_hwrei
Stats::Scalar _hwrei
Definition:
kernel_stats.hh:63
AlphaISA::Kernel::Statistics
Definition:
kernel_stats.hh:51
AlphaISA::Kernel::Statistics::themode
cpu_mode themode
Definition:
kernel_stats.hh:55
Kernel::Statistics::name
const std::string name() const
Definition:
kernel_stats.hh:55
AlphaISA::Kernel::Statistics::setIdleProcess
void setIdleProcess(Addr idle, ThreadContext *tc)
Definition:
kernel_stats.cc:156
AlphaISA::Kernel::Statistics::_callpal
Stats::Vector _callpal
Definition:
kernel_stats.hh:61
CheckpointOut
std::ostream CheckpointOut
Definition:
serialize.hh:68
AlphaISA::Kernel::user
Definition:
kernel_stats.hh:48
AlphaISA::Kernel::kernel
Definition:
kernel_stats.hh:48
Kernel
Definition:
thread_context.hh:55
kernel_stats.hh
AlphaISA::Kernel::Statistics::_modeTicks
Stats::Vector _modeTicks
Definition:
kernel_stats.hh:68
AlphaISA::Kernel::Statistics::iplLastTick
Tick iplLastTick
Definition:
kernel_stats.hh:79
AlphaISA
Definition:
decoder.cc:33
MipsISA::ipl
Bitfield< 15, 10 > ipl
Definition:
pra_constants.hh:122
AlphaISA::Kernel::Statistics::Statistics
Statistics()
Definition:
kernel_stats.cc:53
AlphaISA::Kernel::Statistics::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition:
kernel_stats.cc:233
Generated on Fri Feb 28 2020 16:26:56 for gem5 by
doxygen
1.8.13