From: Gabe Black Date: Fri, 7 Feb 2020 01:34:41 +0000 (-0800) Subject: arch,cpu,sim: Eliminate the now empty kernel statistics classes. X-Git-Tag: v20.1.0.0~582 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=187ba10c922f82c80c38c44557802a222c5da07e;p=gem5.git arch,cpu,sim: Eliminate the now empty kernel statistics classes. This includes the base and ISA specific Kernel::Statistics classes, the plumbing through ThreadContext to access them, and the switching header file associated with them. Change-Id: Ia511a59325b629aa9ccc0e695ddd47ff11916499 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25149 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- diff --git a/src/arch/SConscript b/src/arch/SConscript index 13ab8fbd7..978f72a67 100644 --- a/src/arch/SConscript +++ b/src/arch/SConscript @@ -60,7 +60,6 @@ env.SwitchingHeaders( decoder.hh isa.hh isa_traits.hh - kernel_stats.hh locked_mem.hh microcode_rom.hh pseudo_inst.hh diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh b/src/arch/arm/fastmodel/iris/thread_context.hh index 6b1606942..5a4efd56d 100644 --- a/src/arch/arm/fastmodel/iris/thread_context.hh +++ b/src/arch/arm/fastmodel/iris/thread_context.hh @@ -216,12 +216,6 @@ class ThreadContext : public ::ThreadContext panic("%s not implemented.", __FUNCTION__); } - Kernel::Statistics * - getKernelStats() override - { - panic("%s not implemented.", __FUNCTION__); - } - PortProxy &getPhysProxy() override { return *physProxy; } PortProxy &getVirtProxy() override { return *virtProxy; } void initMemProxies(::ThreadContext *tc) override; diff --git a/src/arch/arm/kernel_stats.hh b/src/arch/arm/kernel_stats.hh deleted file mode 100644 index 4eb10a5cd..000000000 --- a/src/arch/arm/kernel_stats.hh +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ARCH_ARM_KERNEL_STATS_HH__ -#define __ARCH_ARM_KERNEL_STATS_HH__ - -#include "kern/kernel_stats.hh" - -namespace ArmISA { -namespace Kernel { - -class Statistics : public ::Kernel::Statistics -{ - public: - Statistics() : ::Kernel::Statistics() - {} -}; - -} // namespace ArmISA::Kernel -} // namespace ArmISA - -#endif // __ARCH_ARM_KERNEL_STATS_HH__ diff --git a/src/arch/mips/idle_event.cc b/src/arch/mips/idle_event.cc index 6c593bd37..a2b3b0cd6 100644 --- a/src/arch/mips/idle_event.cc +++ b/src/arch/mips/idle_event.cc @@ -28,7 +28,6 @@ #include "arch/mips/idle_event.hh" -#include "arch/mips/kernel_stats.hh" #include "cpu/thread_context.hh" using namespace MipsISA; diff --git a/src/arch/mips/kernel_stats.hh b/src/arch/mips/kernel_stats.hh deleted file mode 100644 index 065d73aec..000000000 --- a/src/arch/mips/kernel_stats.hh +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ARCH_MIPS_KERNEL_STATS_HH__ -#define __ARCH_MIPS_KERNEL_STATS_HH__ - -#include "kern/kernel_stats.hh" - -namespace MipsISA { -namespace Kernel { - -class Statistics : public ::Kernel::Statistics -{ - public: - Statistics() : ::Kernel::Statistics() - {} -}; - -} // namespace MipsISA::Kernel -} // namespace MipsISA - -#endif // __ARCH_MIPS_KERNEL_STATS_HH__ diff --git a/src/arch/power/kernel_stats.hh b/src/arch/power/kernel_stats.hh deleted file mode 100644 index f1eabfd4a..000000000 --- a/src/arch/power/kernel_stats.hh +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ARCH_POWER_KERNEL_STATS_HH__ -#define __ARCH_POWER_KERNEL_STATS_HH__ - -#include "kern/kernel_stats.hh" - -namespace PowerISA { -namespace Kernel { - -class Statistics : public ::Kernel::Statistics -{ - public: - Statistics() : ::Kernel::Statistics() - {} -}; - -} // namespace PowerISA::Kernel -} // namespace PowerISA - -#endif // __ARCH_POWER_KERNEL_STATS_HH__ diff --git a/src/arch/riscv/idle_event.cc b/src/arch/riscv/idle_event.cc index 5b56c272c..88256b99b 100644 --- a/src/arch/riscv/idle_event.cc +++ b/src/arch/riscv/idle_event.cc @@ -28,7 +28,6 @@ #include "arch/riscv/idle_event.hh" -#include "arch/riscv/kernel_stats.hh" #include "cpu/thread_context.hh" using namespace RiscvISA; diff --git a/src/arch/riscv/kernel_stats.hh b/src/arch/riscv/kernel_stats.hh deleted file mode 100644 index 6435bcb20..000000000 --- a/src/arch/riscv/kernel_stats.hh +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ARCH_RISCV_KERNEL_STATS_HH__ -#define __ARCH_RISCV_KERNEL_STATS_HH__ - -#include "kern/kernel_stats.hh" - -namespace RiscvISA { -namespace Kernel { - -class Statistics : public ::Kernel::Statistics -{ - public: - Statistics() : ::Kernel::Statistics() - {} -}; - -} // namespace RiscvISA::Kernel -} // namespace RiscvISA - -#endif // __ARCH_RISCV_KERNEL_STATS_HH__ diff --git a/src/arch/sparc/kernel_stats.hh b/src/arch/sparc/kernel_stats.hh deleted file mode 100644 index 41a8dd04d..000000000 --- a/src/arch/sparc/kernel_stats.hh +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ARCH_SPARC_KERNEL_STATS_HH__ -#define __ARCH_SPARC_KERNEL_STATS_HH__ - -#include -#include -#include -#include - -#include "kern/kernel_stats.hh" - -namespace SparcISA { -namespace Kernel { - -class Statistics : public ::Kernel::Statistics -{ - public: - Statistics() : ::Kernel::Statistics() - {} -}; - -} // namespace SparcISA::Kernel -} // namespace SparcISA - -#endif // __ARCH_SPARC_KERNEL_STATS_HH__ diff --git a/src/arch/x86/kernel_stats.hh b/src/arch/x86/kernel_stats.hh deleted file mode 100644 index 44980d4cb..000000000 --- a/src/arch/x86/kernel_stats.hh +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2007 The Hewlett-Packard Development Company - * All rights reserved. - * - * The license below extends only to copyright in the software and shall - * not be construed as granting a license to any other intellectual - * property including but not limited to intellectual property relating - * to a hardware implementation of the functionality of the software - * licensed hereunder. You may use the software subject to the license - * terms below provided that you ensure that this notice is replicated - * unmodified and in its entirety in all distributions of the software, - * modified or unmodified, in source code or in binary form. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ARCH_X86_KERNELSTATS_HH__ -#define __ARCH_X86_KERNELSTATS_HH__ - -#include "kern/kernel_stats.hh" - -namespace X86ISA { -namespace Kernel { - -class Statistics : public ::Kernel::Statistics -{ - public: - Statistics() : ::Kernel::Statistics() - {} -}; - -} -} - -#endif // __ARCH_X86_KERNELSTATS_HH__ diff --git a/src/cpu/checker/cpu.cc b/src/cpu/checker/cpu.cc index b62a5c605..d9d6d7efa 100644 --- a/src/cpu/checker/cpu.cc +++ b/src/cpu/checker/cpu.cc @@ -99,8 +99,7 @@ CheckerCPU::setSystem(System *system) systemPtr = system; if (FullSystem) { - thread = new SimpleThread(this, 0, systemPtr, itb, dtb, - p->isa[0], false); + thread = new SimpleThread(this, 0, systemPtr, itb, dtb, p->isa[0]); } else { thread = new SimpleThread(this, 0, systemPtr, workload.size() ? workload[0] : NULL, @@ -109,7 +108,6 @@ CheckerCPU::setSystem(System *system) tc = thread->getTC(); threadContexts.push_back(tc); - thread->kernelStats = NULL; // Thread should never be null after this assert(thread != NULL); } diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh index 52ea7d2b2..18f4068d7 100644 --- a/src/cpu/checker/thread_context.hh +++ b/src/cpu/checker/thread_context.hh @@ -50,12 +50,10 @@ #include "debug/Checker.hh" class EndQuiesceEvent; -namespace Kernel { - class Statistics; -}; -namespace TheISA { +namespace TheISA +{ class Decoder; -}; +} // namespace TheISA /** * Derived ThreadContext class for use with the Checker. The template @@ -150,12 +148,6 @@ class CheckerThreadContext : public ThreadContext System *getSystemPtr() override { return actualTC->getSystemPtr(); } - ::Kernel::Statistics * - getKernelStats() override - { - return actualTC->getKernelStats(); - } - Process *getProcessPtr() override { return actualTC->getProcessPtr(); } void setProcessPtr(Process *p) override { actualTC->setProcessPtr(p); } diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index b3faf315d..21bcf56c7 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -43,7 +43,6 @@ #include "cpu/o3/cpu.hh" #include "arch/generic/traits.hh" -#include "arch/kernel_stats.hh" #include "config/the_isa.hh" #include "cpu/activity.hh" #include "cpu/checker/cpu.hh" diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh index 3cb3e97b2..042ad1c26 100644 --- a/src/cpu/o3/thread_context.hh +++ b/src/cpu/o3/thread_context.hh @@ -47,9 +47,6 @@ #include "cpu/thread_context.hh" class EndQuiesceEvent; -namespace Kernel { - class Statistics; -} /** * Derived ThreadContext class for use with the O3CPU. It @@ -143,13 +140,6 @@ class O3ThreadContext : public ThreadContext /** Returns a pointer to the system. */ System *getSystemPtr() override { return cpu->system; } - /** Returns a pointer to this thread's kernel statistics. */ - ::Kernel::Statistics * - getKernelStats() override - { - return thread->kernelStats; - } - /** Returns a pointer to this thread's process. */ Process *getProcessPtr() override { return thread->getProcessPtr(); } @@ -192,9 +182,6 @@ class O3ThreadContext : public ThreadContext /** Takes over execution of a thread from another CPU. */ void takeOverFrom(ThreadContext *old_context) override; - /** Registers statistics associated with this TC. */ - void regStats(const std::string &name) override; - /** Reads the last tick that this thread was activated on. */ Tick readLastActivate() override; /** Reads the last tick that this thread was suspended on. */ diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index d02be717b..034b9891d 100644 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -43,7 +43,6 @@ #define __CPU_O3_THREAD_CONTEXT_IMPL_HH__ #include "arch/generic/traits.hh" -#include "arch/kernel_stats.hh" #include "arch/registers.hh" #include "config/the_isa.hh" #include "cpu/o3/thread_context.hh" @@ -76,7 +75,6 @@ O3ThreadContext::takeOverFrom(ThreadContext *old_context) TheISA::Decoder *oldDecoder = old_context->getDecoderPtr(); newDecoder->takeOverFrom(oldDecoder); - thread->kernelStats = old_context->getKernelStats(); thread->funcExeInst = old_context->readFuncExeInst(); thread->noSquashFromTC = false; @@ -142,16 +140,6 @@ O3ThreadContext::halt() cpu->addThreadToExitingList(thread->threadId()); } -template -void -O3ThreadContext::regStats(const std::string &name) -{ - if (FullSystem) { - thread->kernelStats = new TheISA::Kernel::Statistics(); - thread->kernelStats->regStats(name + ".kern"); - } -} - template Tick O3ThreadContext::readLastActivate() diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc index d0c6bf440..20ada332c 100644 --- a/src/cpu/simple_thread.cc +++ b/src/cpu/simple_thread.cc @@ -43,7 +43,6 @@ #include #include "arch/isa_traits.hh" -#include "arch/kernel_stats.hh" #include "arch/stacktrace.hh" #include "arch/utility.hh" #include "base/callback.hh" @@ -83,8 +82,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys, } SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys, - BaseTLB *_itb, BaseTLB *_dtb, - BaseISA *_isa, bool use_kernel_stats) + BaseTLB *_itb, BaseTLB *_dtb, BaseISA *_isa) : ThreadState(_cpu, _thread_num, NULL), isa(dynamic_cast(_isa)), predicate(true), memAccPredicate(true), @@ -110,9 +108,6 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys, static ProfileNode dummyNode; profileNode = &dummyNode; profilePC = 3; - - if (use_kernel_stats) - kernelStats = new TheISA::Kernel::Statistics(); } void @@ -123,7 +118,6 @@ SimpleThread::takeOverFrom(ThreadContext *oldContext) isa->takeOverFrom(this, oldContext); - kernelStats = oldContext->getKernelStats(); funcExeInst = oldContext->readFuncExeInst(); storeCondFailures = 0; } @@ -198,14 +192,6 @@ SimpleThread::halt() baseCpu->haltContext(_threadId); } - -void -SimpleThread::regStats(const string &name) -{ - if (FullSystem && kernelStats) - kernelStats->regStats(name + ".kern"); -} - void SimpleThread::copyArchRegs(ThreadContext *src_tc) { diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index 6118541f2..9e6a2a71b 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -74,10 +74,6 @@ class CheckerCPU; class FunctionProfile; class ProfileNode; -namespace Kernel { - class Statistics; -} - /** * The SimpleThread object provides a combination of the ThreadState * object and the ThreadContext interface. It implements the @@ -141,8 +137,7 @@ class SimpleThread : public ThreadState, public ThreadContext // constructor: initialize SimpleThread from given process structure // FS SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system, - BaseTLB *_itb, BaseTLB *_dtb, BaseISA *_isa, - bool use_kernel_stats = true); + BaseTLB *_itb, BaseTLB *_dtb, BaseISA *_isa); // SE SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system, Process *_process, BaseTLB *_itb, BaseTLB *_dtb, @@ -152,8 +147,6 @@ class SimpleThread : public ThreadState, public ThreadContext void takeOverFrom(ThreadContext *oldContext) override; - void regStats(const std::string &name) override; - void copyState(ThreadContext *oldContext); void serialize(CheckpointOut &cp) const override; @@ -232,12 +225,6 @@ class SimpleThread : public ThreadState, public ThreadContext System *getSystemPtr() override { return system; } - Kernel::Statistics * - getKernelStats() override - { - return ThreadState::getKernelStats(); - } - PortProxy &getPhysProxy() override { return ThreadState::getPhysProxy(); } PortProxy &getVirtProxy() override { return ThreadState::getVirtProxy(); } diff --git a/src/cpu/thread_context.cc b/src/cpu/thread_context.cc index 193073979..83ed55230 100644 --- a/src/cpu/thread_context.cc +++ b/src/cpu/thread_context.cc @@ -49,7 +49,6 @@ #include "cpu/quiesce_event.hh" #include "debug/Context.hh" #include "debug/Quiesce.hh" -#include "kern/kernel_stats.hh" #include "params/BaseCPU.hh" #include "sim/full_system.hh" diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh index 4907b846c..fdd6b8a53 100644 --- a/src/cpu/thread_context.hh +++ b/src/cpu/thread_context.hh @@ -68,9 +68,6 @@ class EndQuiesceEvent; class PortProxy; class Process; class System; -namespace Kernel { - class Statistics; -} /** * ThreadContext is the external interface to all thread state for @@ -146,8 +143,6 @@ class ThreadContext : public PCEventScope virtual System *getSystemPtr() = 0; - virtual ::Kernel::Statistics *getKernelStats() = 0; - virtual PortProxy &getPhysProxy() = 0; virtual PortProxy &getVirtProxy() = 0; @@ -187,7 +182,7 @@ class ThreadContext : public PCEventScope virtual void takeOverFrom(ThreadContext *old_context) = 0; - virtual void regStats(const std::string &name) = 0; + virtual void regStats(const std::string &name) {}; virtual EndQuiesceEvent *getQuiesceEvent() = 0; diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc index 07176b72e..741d119b4 100644 --- a/src/cpu/thread_state.cc +++ b/src/cpu/thread_state.cc @@ -32,7 +32,6 @@ #include "cpu/base.hh" #include "cpu/profile.hh" #include "cpu/quiesce_event.hh" -#include "kern/kernel_stats.hh" #include "mem/port.hh" #include "mem/port_proxy.hh" #include "mem/se_translating_port_proxy.hh" @@ -46,7 +45,7 @@ ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process) _status(ThreadContext::Halted), baseCpu(cpu), _contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0), profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL), - kernelStats(NULL), process(_process), physProxy(NULL), virtProxy(NULL), + process(_process), physProxy(NULL), virtProxy(NULL), funcExeInst(0), storeCondFailures(0) { } @@ -73,8 +72,6 @@ ThreadState::serialize(CheckpointOut &cp) const if (quiesceEvent->scheduled()) quiesceEndTick = quiesceEvent->when(); SERIALIZE_SCALAR(quiesceEndTick); - if (kernelStats) - kernelStats->serialize(cp); } void @@ -92,8 +89,6 @@ ThreadState::unserialize(CheckpointIn &cp) UNSERIALIZE_SCALAR(quiesceEndTick); if (quiesceEndTick) baseCpu->schedule(quiesceEvent, quiesceEndTick); - if (kernelStats) - kernelStats->unserialize(cp); } void diff --git a/src/cpu/thread_state.hh b/src/cpu/thread_state.hh index dd93c68f4..1bbf4464f 100644 --- a/src/cpu/thread_state.hh +++ b/src/cpu/thread_state.hh @@ -39,9 +39,6 @@ class EndQuiesceEvent; class FunctionProfile; class ProfileNode; -namespace Kernel { - class Statistics; -} class Checkpoint; @@ -94,8 +91,6 @@ struct ThreadState : public Serializable { void profileSample(); - Kernel::Statistics *getKernelStats() { return kernelStats; } - PortProxy &getPhysProxy(); PortProxy &getVirtProxy(); @@ -166,8 +161,6 @@ struct ThreadState : public Serializable { Addr profilePC; EndQuiesceEvent *quiesceEvent; - Kernel::Statistics *kernelStats; - protected: Process *process; diff --git a/src/kern/kernel_stats.hh b/src/kern/kernel_stats.hh deleted file mode 100644 index 0fbbca4fc..000000000 --- a/src/kern/kernel_stats.hh +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __KERNEL_STATS_HH__ -#define __KERNEL_STATS_HH__ - -#include - -#include "sim/serialize.hh" -#include "sim/stats.hh" - -// What does kernel stats expect is included? -namespace Kernel -{ - -class Statistics : public Serializable -{ - protected: - std::string myname; - - public: - virtual ~Statistics() {} - - const std::string name() const { return myname; } - virtual void regStats(const std::string &name) { myname = name; }; - - void serialize(CheckpointOut &cp) const override {} - void unserialize(CheckpointIn &cp) override {} -}; - -} // namespace Kernel - -#endif // __KERNEL_STATS_HH__ diff --git a/src/sim/system.cc b/src/sim/system.cc index 557ad7dc6..2bd781566 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -67,15 +67,6 @@ #include "sim/full_system.hh" #include "sim/redirect_path.hh" -/** - * To avoid linking errors with LTO, only include the header if we - * actually have a definition. - */ -#if THE_ISA != NULL_ISA -#include "kern/kernel_stats.hh" - -#endif - using namespace std; using namespace TheISA;