Some more useful debugging info for kernel panic and die events

Increase the default number of CSHR's, we should really fix this or make it a parameter

Use a setBlocked call to tell the bus it should block

New technique for sampling and switchover:
1) Sampler switchover event happens
2) All cpus in the current phase of sampling associated with this sampler are signaled to switchover
3) Each cpu drains it's pipe of things being executed (stops fetching and waits for empty pipe)
4) Once the pipe is empty the cpu calls back to the sampler to signal it has finished, and moves into the switchedout state (continues not to fetch)
5) The sampler collects all the signals, once all cpus are drained it calls the new cpu's in the next phase to takeover from the correct cpu
6) The statistics are reset and the next switchover time is calculated from this point

cpu/base_cpu.cc:
cpu/base_cpu.hh:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
    Reconfigure the way the sampling switchover works
cpu/pc_event.cc:
    More debugging information on kernel panic's
kern/linux/linux_system.cc:
    More debug info for Kernel Die events
kern/linux/linux_system.hh:
    More debug info for kernel die events

--HG--
extra : convert_revision : 61cc42e43ba738705aa1f1d167b65d4d6dee51ae
This commit is contained in:
Ron Dreslinski 2005-02-09 10:27:00 -05:00
parent bc0661a3da
commit d9317dd348
7 changed files with 58 additions and 20 deletions

View file

@ -35,6 +35,7 @@
#include "base/misc.hh"
#include "cpu/base_cpu.hh"
#include "cpu/exec_context.hh"
#include "cpu/sampling_cpu/sampling_cpu.hh"
#include "sim/param.hh"
#include "sim/sim_events.hh"
@ -210,9 +211,10 @@ BaseCPU::registerExecContexts()
void
BaseCPU::switchOut()
BaseCPU::switchOut(SamplingCPU *sampler)
{
// default: do nothing
// default: do nothing, signal done
sampler->signalSwitched();
}
void

View file

@ -32,6 +32,7 @@
#include <vector>
#include "base/statistics.hh"
#include "cpu/sampling_cpu/sampling_cpu.hh"
#include "sim/eventq.hh"
#include "sim/sim_object.hh"
#include "targetarch/isa_traits.hh"
@ -114,9 +115,9 @@ class BaseCPU : public SimObject
bool deferRegistration;
void registerExecContexts();
/// Prepare for another CPU to take over execution. Called by
/// takeOverFrom() on its argument.
virtual void switchOut();
/// Prepare for another CPU to take over execution. When it is
/// is ready (drained pipe) it signals the sampler.
virtual void switchOut(SamplingCPU *);
/// Take over execution from the given CPU. Used for warm-up and
/// sampling.

View file

@ -31,10 +31,11 @@
#include <string>
#include <utility>
#include "sim/debug.hh"
#include "base/trace.hh"
#include "cpu/base_cpu.hh"
#include "cpu/exec_context.hh"
#include "cpu/pc_event.hh"
#include "base/trace.hh"
#include "sim/debug.hh"
#include "sim/universe.hh"
using namespace std;
@ -123,6 +124,8 @@ BreakPCEvent::BreakPCEvent(PCEventQueue *q, const std::string &desc, bool del)
void
BreakPCEvent::process(ExecContext *xc)
{
StringWrap name(xc->cpu->name() + ".break_event");
DPRINTFN("break event %s triggered", descr());
debug_break();
if (remove)
delete this;

View file

@ -47,6 +47,7 @@
#include "cpu/exec_context.hh"
#include "cpu/exetrace.hh"
#include "cpu/full_cpu/smt.hh"
#include "cpu/sampling_cpu/sampling_cpu.hh"
#include "cpu/simple_cpu/simple_cpu.hh"
#include "cpu/static_inst.hh"
#include "mem/base_mem.hh"
@ -179,11 +180,21 @@ SimpleCPU::~SimpleCPU()
}
void
SimpleCPU::switchOut()
SimpleCPU::switchOut(SamplingCPU *s)
{
_status = SwitchedOut;
if (tickEvent.scheduled())
tickEvent.squash();
sampler = s;
if (status() == DcacheMissStall) {
DPRINTF(Sampler,"Outstanding dcache access, waiting for completion\n");
_status = DcacheMissSwitch;
}
else {
_status = SwitchedOut;
if (tickEvent.scheduled())
tickEvent.squash();
sampler->signalSwitched();
}
}
@ -203,8 +214,6 @@ SimpleCPU::takeOverFrom(BaseCPU *oldCPU)
tickEvent.schedule(curTick);
}
}
oldCPU->switchOut();
}
@ -631,6 +640,12 @@ SimpleCPU::processCacheCompletion()
_status = Running;
scheduleTickEvent(1);
break;
case DcacheMissSwitch:
if (memReq->cmd.isRead()) {
curStaticInst->execute(this,traceData);
}
_status = SwitchedOut;
sampler->signalSwitched();
case SwitchedOut:
// If this CPU has been switched out due to sampling/warm-up,
// ignore any further status changes (e.g., due to cache

View file

@ -29,12 +29,13 @@
#ifndef __SIMPLE_CPU_HH__
#define __SIMPLE_CPU_HH__
#include "cpu/base_cpu.hh"
#include "sim/eventq.hh"
#include "cpu/pc_event.hh"
#include "base/statistics.hh"
#include "cpu/base_cpu.hh"
#include "cpu/exec_context.hh"
#include "cpu/pc_event.hh"
#include "cpu/sampling_cpu/sampling_cpu.hh"
#include "cpu/static_inst.hh"
#include "sim/eventq.hh"
// forward declarations
#ifdef FULL_SYSTEM
@ -117,6 +118,7 @@ class SimpleCPU : public BaseCPU
IcacheMissStall,
IcacheMissComplete,
DcacheMissStall,
DcacheMissSwitch,
SwitchedOut
};
@ -163,7 +165,7 @@ class SimpleCPU : public BaseCPU
// execution context
ExecContext *xc;
void switchOut();
void switchOut(SamplingCPU *s);
void takeOverFrom(BaseCPU *oldCPU);
#ifdef FULL_SYSTEM
@ -184,6 +186,11 @@ class SimpleCPU : public BaseCPU
// Refcounted pointer to the one memory request.
MemReqPtr memReq;
// Pointer to the sampler that is telling us to switchover.
// Used to signal the completion of the pipe drain and schedule
// the next switchover
SamplingCPU *sampler;
StaticInstPtr<TheISA> curStaticInst;
class CacheCompletionEvent : public Event

View file

@ -102,12 +102,19 @@ LinuxSystem::LinuxSystem(Params *p)
} else
panic("could not find dp264_mv\n");
#ifdef DEBUG
#ifndef NDEBUG
kernelPanicEvent = new BreakPCEvent(&pcEventQueue, "kernel panic");
if (kernelSymtab->findAddress("panic", addr))
kernelPanicEvent->schedule(addr);
else
panic("could not find kernel symbol \'panic\'");
kernelDieEvent = new BreakPCEvent(&pcEventQueue, "die if kernel");
if (kernelSymtab->findAddress("die_if_kernel", addr))
kernelDieEvent->schedule(addr);
else
panic("could not find kernel symbol \'die_if_kernel\'");
#endif
/**
@ -174,7 +181,7 @@ LinuxSystem::LinuxSystem(Params *p)
LinuxSystem::~LinuxSystem()
{
#ifdef DEBUG
#ifndef NDEBUG
delete kernelPanicEvent;
#endif
delete skipIdeDelay50msEvent;

View file

@ -57,9 +57,12 @@ class PrintThreadInfo;
class LinuxSystem : public System
{
private:
#ifdef DEBUG
#ifndef NDEBUG
/** Event to halt the simulator if the kernel calls panic() */
BreakPCEvent *kernelPanicEvent;
/** Event to halt the simulator if the kernel calls die_if_kernel */
BreakPCEvent *kernelDieEvent;
#endif
/**