code.
base/statistics.hh:
We're getting rid of FS_MEASURE, but for now, we're going
to still use a compile time flag to turn on and off binning
of statistics. (The flag is STATS_BINNING)
cpu/exec_context.cc:
cpu/exec_context.hh:
kern/tru64/tru64_system.cc:
get rid of FS_MEASURE
cpu/simple_cpu/simple_cpu.cc:
yank the function call tracking code out of the cpu and move
it into the software context class itself.
kern/tru64/tru64_system.hh:
get rid of FS_MEASURE
move all of the tacking stuff to the same place.
sim/system.hh:
cleanup
--HG--
extra : convert_revision :
73d3843afe1b3ba0d5445421c39c1148d3f4e7c0
* binned. If the typedef is NoBin, nothing is binned. If it is
* MainBin, then all stats are binned under that Bin.
*/
-#ifdef FS_MEASURE
+#if defined(STATS_BINNING)
typedef MainBin DefaultBin;
#else
typedef NoBin DefaultBin;
kernelStats(this, _cpu), cpu(_cpu), thread_num(_thread_num),
cpu_id(-1), mem(_mem), itb(_itb), dtb(_dtb), system(_sys),
memCtrl(_sys->memCtrl), physmem(_sys->physmem),
-#ifdef FS_MEASURE
- swCtx(NULL),
-#endif
- func_exe_inst(0), storeCondFailures(0)
+ swCtx(NULL), func_exe_inst(0), storeCondFailures(0)
{
memset(®s, 0, sizeof(RegFile));
}
#include "kern/tru64/kernel_stats.hh"
#include "sim/system.hh"
-
-#ifdef FS_MEASURE
#include "sim/sw_context.hh"
-#endif
#else // !FULL_SYSTEM
MemoryController *memCtrl;
PhysicalMemory *physmem;
-#ifdef FS_MEASURE
SWContext *swCtx;
-#endif
-
#else
Process *process;
xc->func_exe_inst++;
fault = si->execute(this, xc, traceData);
-#ifdef FS_MEASURE
- if (!(xc->misspeculating()) && (xc->system->bin)) {
- SWContext *ctx = xc->swCtx;
- if (ctx && !ctx->callStack.empty()) {
- if (si->isCall()) {
- ctx->calls++;
- }
- if (si->isReturn()) {
- if (ctx->calls == 0) {
- fnCall *top = ctx->callStack.top();
- DPRINTF(TCPIP, "Removing %s from callstack.\n", top->name);
- delete top;
- ctx->callStack.pop();
- if (ctx->callStack.empty())
- xc->system->nonPath->activate();
- else
- ctx->callStack.top()->myBin->activate();
-
- xc->system->dumpState(xc);
- } else {
- ctx->calls--;
- }
- }
- }
- }
+
+#ifdef FULL_SYSTEM
+ SWContext *ctx = xc->swCtx;
+ if (ctx)
+ ctx->process(xc, si.get());
#endif
+
if (si->isMemRef()) {
numMemRefs++;
}
return remoteGDB[0]->trap(ALPHA_KENTRY_INT);
}
-#ifdef FS_MEASURE
void
Tru64System::populateMap(std::string callee, std::string caller)
{
}
}
}
-#endif //FS_MEASURE
BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System)
INIT_PARAM(console_code, "file that contains the console code"),
INIT_PARAM(pal_code, "file that contains palcode"),
INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot",
- "a")
+ "a")
END_INIT_SIM_OBJECT_PARAMS(Tru64System)
#ifndef __TRU64_SYSTEM_HH__
#define __TRU64_SYSTEM_HH__
+#include <map>
#include <vector>
#include "sim/system.hh"
#include "targetarch/isa_traits.hh"
-#ifdef FS_MEASURE
-#include <map>
-#endif
-
class ExecContext;
class EcoffObject;
class SymbolTable;
class PrintfEvent;
class DebugPrintfEvent;
class DumpMbufEvent;
-#ifdef FS_MEASURE
class FnEvent;
-#endif
class AlphaArguments;
class Tru64System : public System
Addr kernelEntry;
bool bin;
-#ifdef FS_MEASURE
- std::multimap<const std::string, std::string> callerMap;
- void populateMap(std::string caller, std::string callee);
-#endif
-
public:
std::vector<RemoteGDB *> remoteGDB;
std::vector<GDBListener *> gdbListen;
const std::string &console_path,
const std::string &palcode,
const std::string &boot_osflags,
- const bool _bin);
+ const bool _bin);
~Tru64System();
int registerExecContext(ExecContext *xc);
static void Printf(AlphaArguments args);
static void DumpMbuf(AlphaArguments args);
-#ifdef FS_MEASURE
+
+ // Lisa's fs measure stuff
+ private:
+ std::multimap<const std::string, std::string> callerMap;
+ void populateMap(std::string caller, std::string callee);
+
+ public:
bool findCaller(std::string callee, std::string caller) const;
void dumpState(ExecContext *xc) const;
-#endif //FS_MEASURE
};
#endif // __TRU64_SYSTEM_HH__
#include <string>
#include <vector>
-#include "sim/sim_object.hh"
-#include "cpu/pc_event.hh"
#include "base/loader/symtab.hh"
-
-#ifdef FS_MEASURE
#include "base/statistics.hh"
+#include "cpu/pc_event.hh"
+#include "sim/sim_object.hh"
#include "sim/sw_context.hh"
-#endif
class MemoryController;
class PhysicalMemory;
class System : public SimObject
{
-#ifdef FS_MEASURE
+ // lisa's binning stuff
protected:
std::map<const std::string, Statistics::MainBin *> fnBins;
std::map<const Addr, SWContext *> swCtxMap;
-#endif //FS_MEASURE
+
+ public:
+ Statistics::Scalar<Counter> fnCalls;
+ Statistics::MainBin *nonPath;
+
+ Statistics::MainBin * getBin(const std::string &name);
+ virtual bool findCaller(std::string, std::string) const = 0;
+
+ SWContext *findContext(Addr pcb);
+ bool addContext(Addr pcb, SWContext *ctx) {
+ return (swCtxMap.insert(make_pair(pcb, ctx))).second;
+ }
+ void remContext(Addr pcb) {
+ swCtxMap.erase(pcb);
+ return;
+ }
+
+ virtual void dumpState(ExecContext *xc) const = 0;
public:
const uint64_t init_param;
virtual int registerExecContext(ExecContext *xc);
virtual void replaceExecContext(int xcIndex, ExecContext *xc);
-#ifdef FS_MEASURE
- Statistics::Scalar<Counter, Statistics::MainBin> fnCalls;
- Statistics::MainBin *nonPath;
-#endif //FS_MEASURE
-
public:
System(const std::string _name, const uint64_t _init_param,
MemoryController *, PhysicalMemory *, const bool);
virtual Addr getKernelEntry() const = 0;
virtual bool breakpoint() = 0;
-#ifdef FS_MEASURE
- Statistics::MainBin * getBin(const std::string &name);
- virtual bool findCaller(std::string, std::string) const = 0;
-
- SWContext *findContext(Addr pcb);
- bool addContext(Addr pcb, SWContext *ctx) {
- return (swCtxMap.insert(make_pair(pcb, ctx))).second;
- }
- void remContext(Addr pcb) {
- swCtxMap.erase(pcb);
- return;
- }
-
- virtual void dumpState(ExecContext *xc) const = 0;
-#endif //FS_MEASURE
-
public:
////////////////////////////////////////////
//