kernel_stats.hh (2665:a124942bacb8) kernel_stats.hh (2680:246e7104f744)
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;

--- 26 unchanged lines hidden (view full) ---

35#include <map>
36#include <stack>
37#include <string>
38#include <vector>
39
40#include "cpu/static_inst.hh"
41
42class BaseCPU;
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;

--- 26 unchanged lines hidden (view full) ---

35#include <map>
36#include <stack>
37#include <string>
38#include <vector>
39
40#include "cpu/static_inst.hh"
41
42class BaseCPU;
43class ExecContext;
43class ThreadContext;
44class FnEvent;
45// What does kernel stats expect is included?
46class System;
47
48namespace Kernel {
49
50enum cpu_mode { kernel, user, idle, interrupt, cpu_mode_num };
51extern const char *modestr[];

--- 50 unchanged lines hidden (view full) ---

102 private:
103 Stats::MainBin *modeBin[cpu_mode_num];
104
105 public:
106 const bool bin;
107 const bool fnbin;
108
109 cpu_mode themode;
44class FnEvent;
45// What does kernel stats expect is included?
46class System;
47
48namespace Kernel {
49
50enum cpu_mode { kernel, user, idle, interrupt, cpu_mode_num };
51extern const char *modestr[];

--- 50 unchanged lines hidden (view full) ---

102 private:
103 Stats::MainBin *modeBin[cpu_mode_num];
104
105 public:
106 const bool bin;
107 const bool fnbin;
108
109 cpu_mode themode;
110 void palSwapContext(ExecContext *xc);
111 void execute(ExecContext *xc, StaticInstPtr inst);
112 void call(ExecContext *xc, Stats::MainBin *myBin);
110 void palSwapContext(ThreadContext *tc);
111 void execute(ThreadContext *tc, StaticInstPtr inst);
112 void call(ThreadContext *tc, Stats::MainBin *myBin);
113 void changeMode(cpu_mode mode);
114
115 public:
116 Binning(System *sys);
117 virtual ~Binning();
118
119 const std::string name() const { return myname; }
120 void regStats(const std::string &name);

--- 11 unchanged lines hidden (view full) ---

132 private:
133 std::string myname;
134
135 Addr idleProcess;
136 cpu_mode themode;
137 Tick lastModeTick;
138 bool bin_int;
139
113 void changeMode(cpu_mode mode);
114
115 public:
116 Binning(System *sys);
117 virtual ~Binning();
118
119 const std::string name() const { return myname; }
120 void regStats(const std::string &name);

--- 11 unchanged lines hidden (view full) ---

132 private:
133 std::string myname;
134
135 Addr idleProcess;
136 cpu_mode themode;
137 Tick lastModeTick;
138 bool bin_int;
139
140 void changeMode(cpu_mode newmode, ExecContext *xc);
140 void changeMode(cpu_mode newmode, ThreadContext *tc);
141
142 private:
143 Stats::Scalar<> _arm;
144 Stats::Scalar<> _quiesce;
145 Stats::Scalar<> _ivlb;
146 Stats::Scalar<> _ivle;
147 Stats::Scalar<> _hwrei;
148

--- 25 unchanged lines hidden (view full) ---

174
175 public:
176 void arm() { _arm++; }
177 void quiesce() { _quiesce++; }
178 void ivlb() { _ivlb++; }
179 void ivle() { _ivle++; }
180 void hwrei() { _hwrei++; }
181 void swpipl(int ipl);
141
142 private:
143 Stats::Scalar<> _arm;
144 Stats::Scalar<> _quiesce;
145 Stats::Scalar<> _ivlb;
146 Stats::Scalar<> _ivle;
147 Stats::Scalar<> _hwrei;
148

--- 25 unchanged lines hidden (view full) ---

174
175 public:
176 void arm() { _arm++; }
177 void quiesce() { _quiesce++; }
178 void ivlb() { _ivlb++; }
179 void ivle() { _ivle++; }
180 void hwrei() { _hwrei++; }
181 void swpipl(int ipl);
182 void mode(cpu_mode newmode, ExecContext *xc);
183 void context(Addr oldpcbb, Addr newpcbb, ExecContext *xc);
184 void callpal(int code, ExecContext *xc);
182 void mode(cpu_mode newmode, ThreadContext *tc);
183 void context(Addr oldpcbb, Addr newpcbb, ThreadContext *tc);
184 void callpal(int code, ThreadContext *tc);
185
185
186 void setIdleProcess(Addr idle, ExecContext *xc);
186 void setIdleProcess(Addr idle, ThreadContext *tc);
187
188 public:
189 virtual void serialize(std::ostream &os);
190 virtual void unserialize(Checkpoint *cp, const std::string &section);
191};
192
193/* end namespace Kernel */ }
194
195#endif // __KERNEL_STATS_HH__
187
188 public:
189 virtual void serialize(std::ostream &os);
190 virtual void unserialize(Checkpoint *cp, const std::string &section);
191};
192
193/* end namespace Kernel */ }
194
195#endif // __KERNEL_STATS_HH__