Merge gblack@m5.eecs.umich.edu:/bk/multiarch
[gem5.git] / kern / kernel_stats.hh
index e4d5ec01157eb18cf0e15624f3ff8a7fc5767bef..4896a0705b553c0e46a97851d79131bf31dbf584 100644 (file)
@@ -41,7 +41,6 @@ class ExecContext;
 class FnEvent;
 // What does kernel stats expect is included?
 class System;
-class Fault;
 
 namespace Kernel {
 
@@ -50,8 +49,6 @@ extern const char *modestr[];
 
 class Binning
 {
-  protected:
-    typedef TheISA::Addr Addr;
   private:
     std::string myname;
     System *system;
@@ -126,8 +123,6 @@ class Binning
 
 class Statistics : public Serializable
 {
-  protected:
-    typedef TheISA::Addr Addr;
   private:
     friend class Binning;
 
@@ -156,7 +151,7 @@ class Statistics : public Serializable
 
     Stats::Vector<> _callpal;
     Stats::Vector<> _syscall;
-    Stats::Vector<> _faults;
+//    Stats::Vector<> _faults;
 
     Stats::Vector<> _mode;
     Stats::Vector<> _modeGood;
@@ -181,13 +176,10 @@ class Statistics : public Serializable
     void ivlb() { _ivlb++; }
     void ivle() { _ivle++; }
     void hwrei() { _hwrei++; }
-    void fault(Fault 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]++;
+            if(fault != NoFault)
+                fault->stat()++;
     }// 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);