summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
Diffstat (limited to 'kern')
-rw-r--r--kern/kernel_stats.cc6
-rw-r--r--kern/kernel_stats.hh11
2 files changed, 12 insertions, 5 deletions
diff --git a/kern/kernel_stats.cc b/kern/kernel_stats.cc
index 3a7d12443..50bbaee00 100644
--- a/kern/kernel_stats.cc
+++ b/kern/kernel_stats.cc
@@ -137,14 +137,14 @@ Statistics::regStats(const string &_name)
}
_faults
- .init(Num_Faults)
+ .init(NumFaults)
.name(name() + ".faults")
.desc("number of faults")
.flags(total | pdf | nozero | nonan)
;
- for (int i = 1; i < Num_Faults; ++i) {
- const char *str = FaultName(i);
+ for (int i = 1; i < NumFaults; ++i) {
+ const char *str = (*ListOfFaults[i])->name;
if (str)
_faults.subname(i, str);
}
diff --git a/kern/kernel_stats.hh b/kern/kernel_stats.hh
index 62dd84a28..98cc044ac 100644
--- a/kern/kernel_stats.hh
+++ b/kern/kernel_stats.hh
@@ -41,7 +41,7 @@ class ExecContext;
class FnEvent;
// What does kernel stats expect is included?
class System;
-enum Fault;
+class Fault;
namespace Kernel {
@@ -176,7 +176,14 @@ class Statistics : public Serializable
void ivlb() { _ivlb++; }
void ivle() { _ivle++; }
void hwrei() { _hwrei++; }
- void fault(Fault fault) { _faults[fault]++; }
+ void fault(Fault * fault)
+ {
+ if(fault == NoFault) _faults[0]++;
+ else if(fault == MachineCheckFault) _faults[2]++;
+ else if(fault == AlignmentFault) _faults[7]++;
+ else if(fault == FakeMemFault) _faults[17]++;
+ else _faults[fault->id]++;
+ }// FIXME: When there are no generic system fault objects, this will go back to _faults[fault]++; }
void swpipl(int ipl);
void mode(cpu_mode newmode);
void context(Addr oldpcbb, Addr newpcbb);