33a34,35
> #include "base/callback.hh"
> #include "base/output.hh"
35a38
> #include "sim/sim_exit.hh"
78,79c81,96
< inSyscall(0), trapPending(0)
< { }
---
> cpu(_cpu), inSyscall(0), trapPending(0)
> {
> if (cpu->params->profile) {
> profile = new FunctionProfile(cpu->params->system->kernelSymtab);
> Callback *cb =
> new MakeCallback<O3ThreadState,
> &O3ThreadState::dumpFuncProfile>(this);
> registerExitCallback(cb);
> }
>
> // let's fill with a dummy node for now so we don't get a segfault
> // on the first cycle when there's no node available.
> static ProfileNode dummyNode;
> profileNode = &dummyNode;
> profilePC = 3;
> }
97a115,122
>
> #if FULL_SYSTEM
> void dumpFuncProfile()
> {
> std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
> profile->dump(xcProxy, *os);
> }
> #endif