diff -r 9d85dfa4696c -r 068e76f5a9ad src/cpu/kvm/base.hh --- a/src/cpu/kvm/base.hh Mon Jun 03 13:21:21 2013 +0200 +++ b/src/cpu/kvm/base.hh Mon Jun 03 13:21:56 2013 +0200 @@ -546,6 +546,9 @@ Stats::Scalar numInterrupts; Stats::Scalar numHypercalls; /* @} */ + + /** Number of instructions executed by the CPU */ + Counter ctrInsts; }; #endif diff -r 9d85dfa4696c -r 068e76f5a9ad src/cpu/kvm/base.cc --- a/src/cpu/kvm/base.cc Mon Jun 03 13:21:21 2013 +0200 +++ b/src/cpu/kvm/base.cc Mon Jun 03 13:21:56 2013 +0200 @@ -80,7 +80,8 @@ pageSize(sysconf(_SC_PAGE_SIZE)), tickEvent(*this), perfControlledByTimer(params->usePerfOverflow), - hostFactor(params->hostFactor) + hostFactor(params->hostFactor), + ctrInsts(0) { if (pageSize == -1) panic("KVM: Failed to determine host page size (%i)\n", @@ -416,14 +417,14 @@ Counter BaseKvmCPU::totalInsts() const { - return hwInstructions.read(); + return ctrInsts; } Counter BaseKvmCPU::totalOps() const { hack_once("Pretending totalOps is equivalent to totalInsts()\n"); - return hwInstructions.read(); + return ctrInsts; } void @@ -514,6 +515,8 @@ numCycles += simCyclesExecuted;; ++numVMExits; numInsts += instsExecuted; + ctrInsts += instsExecuted; + system->totalNumInsts += instsExecuted; DPRINTF(KvmRun, "KVM: Executed %i instructions in %i cycles (%i ticks, sim cycles: %i).\n", instsExecuted, hostCyclesExecuted, ticksExecuted, simCyclesExecuted);