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 <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Gabe Black
2017-08-25 17:39:18 -07:00
parent 725b19a815
commit b9d8700a38
12 changed files with 13 additions and 56 deletions

View File

@@ -50,8 +50,8 @@ namespace Kernel {
const char *modestr[] = { "kernel", "user", "idle" };
Statistics::Statistics(System *system)
: ::Kernel::Statistics(system),
Statistics::Statistics()
: ::Kernel::Statistics(),
idleProcess((Addr)-1), themode(kernel), lastModeTick(0)
{
}

View File

@@ -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 @@ class Statistics : public ::Kernel::Statistics
Stats::Scalar _swap_context;
public:
Statistics(System *system);
Statistics();
void regStats(const std::string &name);

View File

@@ -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()
{}
};

View File

@@ -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

View File

@@ -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()
{}
};

View File

@@ -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

View File

@@ -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()
{}
};

View File

@@ -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()
{}
};

View File

@@ -134,7 +134,7 @@ void
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");
}
}

View File

@@ -100,7 +100,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
profilePC = 3;
if (use_kernel_stats)
kernelStats = new TheISA::Kernel::Statistics(system);
kernelStats = new TheISA::Kernel::Statistics();
}
SimpleThread::~SimpleThread()

View File

@@ -41,7 +41,7 @@ using namespace Stats;
namespace Kernel {
Statistics::Statistics(System *system)
Statistics::Statistics()
: iplLast(0), iplLastTick(0)
{
}

View File

@@ -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 @@ class Statistics : public Serializable
Tick iplLastTick;
public:
Statistics(System *system);
Statistics();
virtual ~Statistics() {}
const std::string name() const { return myname; }