Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/4600 )

Change subject: stats: Get rid of some kernel stats related cruft.
......................................................................

stats: Get rid of some kernel stats related cruft.

The kernel stat mechanism should really be refactored and moved somewhere
else, but in the mean time there's some old cruft that can be cleared away.

Change-Id: I21e725de590dda0d20bf3bc675bbe976c7b1bd86
Reviewed-on: https://gem5-review.googlesource.com/4600
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
---
M src/arch/alpha/kernel_stats.cc
M src/arch/alpha/kernel_stats.hh
M src/arch/arm/kernel_stats.hh
M src/arch/mips/kernel_stats.hh
M src/arch/power/kernel_stats.hh
M src/arch/riscv/kernel_stats.hh
M src/arch/sparc/kernel_stats.hh
M src/arch/x86/kernel_stats.hh
M src/cpu/o3/thread_context_impl.hh
M src/cpu/simple_thread.cc
M src/kern/kernel_stats.cc
M src/kern/kernel_stats.hh
12 files changed, 13 insertions(+), 56 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/src/arch/alpha/kernel_stats.cc b/src/arch/alpha/kernel_stats.cc
index fed8b09..a1ed532 100644
--- a/src/arch/alpha/kernel_stats.cc
+++ b/src/arch/alpha/kernel_stats.cc
@@ -50,8 +50,8 @@

 const char *modestr[] = { "kernel", "user", "idle" };

-Statistics::Statistics(System *system)
-    : ::Kernel::Statistics(system),
+Statistics::Statistics()
+    : ::Kernel::Statistics(),
       idleProcess((Addr)-1), themode(kernel), lastModeTick(0)
 {
 }
diff --git a/src/arch/alpha/kernel_stats.hh b/src/arch/alpha/kernel_stats.hh
index 06d20e6..3b2b5a0 100644
--- a/src/arch/alpha/kernel_stats.hh
+++ b/src/arch/alpha/kernel_stats.hh
@@ -40,11 +40,7 @@
 #include "cpu/static_inst.hh"
 #include "kern/kernel_stats.hh"

-class BaseCPU;
 class ThreadContext;
-class FnEvent;
-// What does kernel stats expect is included?
-class System;

 namespace AlphaISA {
 namespace Kernel {
@@ -73,7 +69,7 @@
     Stats::Scalar _swap_context;

   public:
-    Statistics(System *system);
+    Statistics();

     void regStats(const std::string &name);

diff --git a/src/arch/arm/kernel_stats.hh b/src/arch/arm/kernel_stats.hh
index be5c25b..dd184f8 100644
--- a/src/arch/arm/kernel_stats.hh
+++ b/src/arch/arm/kernel_stats.hh
@@ -31,23 +31,15 @@
 #ifndef __ARCH_ARM_KERNEL_STATS_HH__
 #define __ARCH_ARM_KERNEL_STATS_HH__

-#include <map>
-#include <stack>
-#include <string>
-#include <vector>
-
 #include "kern/kernel_stats.hh"

 namespace ArmISA {
 namespace Kernel {

-enum cpu_mode { hypervisor, kernel, user, idle, cpu_mode_num };
-extern const char *modestr[];
-
 class Statistics : public ::Kernel::Statistics
 {
   public:
-    Statistics(System *system) : ::Kernel::Statistics(system)
+    Statistics() : ::Kernel::Statistics()
     {}
 };

diff --git a/src/arch/mips/kernel_stats.hh b/src/arch/mips/kernel_stats.hh
index 5cf6087..abb964a 100644
--- a/src/arch/mips/kernel_stats.hh
+++ b/src/arch/mips/kernel_stats.hh
@@ -37,17 +37,13 @@
 namespace MipsISA {
 namespace Kernel {

-enum cpu_mode { kernel, user, idle, cpu_mode_num };
-extern const char *modestr[];
-
 class Statistics : public ::Kernel::Statistics
 {
   public:
-    Statistics(System *system) : ::Kernel::Statistics(system)
+    Statistics() : ::Kernel::Statistics()
     {}
 };

-
 } // namespace MipsISA::Kernel
 } // namespace MipsISA

diff --git a/src/arch/power/kernel_stats.hh b/src/arch/power/kernel_stats.hh
index b4d9a69..1ae77d9 100644
--- a/src/arch/power/kernel_stats.hh
+++ b/src/arch/power/kernel_stats.hh
@@ -36,13 +36,10 @@
 namespace PowerISA {
 namespace Kernel {

-enum cpu_mode { hypervisor, kernel, user, idle, cpu_mode_num };
-extern const char *modestr[];
-
 class Statistics : public ::Kernel::Statistics
 {
   public:
-    Statistics(System *system) : ::Kernel::Statistics(system)
+    Statistics() : ::Kernel::Statistics()
     {}
 };

diff --git a/src/arch/riscv/kernel_stats.hh b/src/arch/riscv/kernel_stats.hh
index 6cb6ed0..a796075 100644
--- a/src/arch/riscv/kernel_stats.hh
+++ b/src/arch/riscv/kernel_stats.hh
@@ -37,17 +37,13 @@
 namespace RiscvISA {
 namespace Kernel {

-enum cpu_mode { kernel, user, idle, cpu_mode_num };
-extern const char *modestr[];
-
 class Statistics : public ::Kernel::Statistics
 {
   public:
-    Statistics(System *system) : ::Kernel::Statistics(system)
+    Statistics() : ::Kernel::Statistics()
     {}
 };

-
 } // namespace RiscvISA::Kernel
 } // namespace RiscvISA

diff --git a/src/arch/sparc/kernel_stats.hh b/src/arch/sparc/kernel_stats.hh
index 3d4c677..9c13e52 100644
--- a/src/arch/sparc/kernel_stats.hh
+++ b/src/arch/sparc/kernel_stats.hh
@@ -41,13 +41,10 @@
 namespace SparcISA {
 namespace Kernel {

-enum cpu_mode { hypervisor, kernel, user, idle, cpu_mode_num };
-extern const char *modestr[];
-
 class Statistics : public ::Kernel::Statistics
 {
   public:
-    Statistics(System *system) : ::Kernel::Statistics(system)
+    Statistics() : ::Kernel::Statistics()
     {}
 };

diff --git a/src/arch/x86/kernel_stats.hh b/src/arch/x86/kernel_stats.hh
index e5b9a0c..1a821a0 100644
--- a/src/arch/x86/kernel_stats.hh
+++ b/src/arch/x86/kernel_stats.hh
@@ -45,24 +45,10 @@
 namespace X86ISA {
 namespace Kernel {

-enum cpu_mode {
-    ring0,
-    ring1,
-    ring2,
-    ring3,
-    kernel = ring0,
-    user = ring3,
-    idle,
-    //What is this next one for?
-    cpu_mode_num
-};
-
-extern const char *modestr[];
-
 class Statistics : public ::Kernel::Statistics
 {
   public:
-    Statistics(System * system) : ::Kernel::Statistics(system)
+    Statistics() : ::Kernel::Statistics()
     {}
 };

diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh
index 2d109ae..fdaa351 100755
--- a/src/cpu/o3/thread_context_impl.hh
+++ b/src/cpu/o3/thread_context_impl.hh
@@ -134,7 +134,7 @@
 O3ThreadContext<Impl>::regStats(const std::string &name)
 {
     if (FullSystem) {
-        thread->kernelStats = new TheISA::Kernel::Statistics(cpu->system);
+        thread->kernelStats = new TheISA::Kernel::Statistics();
         thread->kernelStats->regStats(name + ".kern");
     }
 }
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 7c3568c..c775983 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -100,7 +100,7 @@
     profilePC = 3;

     if (use_kernel_stats)
-        kernelStats = new TheISA::Kernel::Statistics(system);
+        kernelStats = new TheISA::Kernel::Statistics();
 }

 SimpleThread::~SimpleThread()
diff --git a/src/kern/kernel_stats.cc b/src/kern/kernel_stats.cc
index f7f57af..37677c1 100644
--- a/src/kern/kernel_stats.cc
+++ b/src/kern/kernel_stats.cc
@@ -41,7 +41,7 @@

 namespace Kernel {

-Statistics::Statistics(System *system)
+Statistics::Statistics()
     : iplLast(0), iplLastTick(0)
 {
 }
diff --git a/src/kern/kernel_stats.hh b/src/kern/kernel_stats.hh
index efaf706..d516baa 100644
--- a/src/kern/kernel_stats.hh
+++ b/src/kern/kernel_stats.hh
@@ -34,13 +34,10 @@

 #include <string>

-#include "config/the_isa.hh"
 #include "sim/serialize.hh"
 #include "sim/stats.hh"

 // What does kernel stats expect is included?
-class System;
-
 namespace Kernel {

 class Statistics : public Serializable
@@ -63,7 +60,7 @@
     Tick iplLastTick;

   public:
-    Statistics(System *system);
+    Statistics();
     virtual ~Statistics() {}

     const std::string name() const { return myname; }

--
To view, visit https://gem5-review.googlesource.com/4600
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I21e725de590dda0d20bf3bc675bbe976c7b1bd86
Gerrit-Change-Number: 4600
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Assignee: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to