From e0074324bacf500f9d0cc11ebc6e2f29bf3d8ba1 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Thu, 16 Oct 2014 05:49:41 -0400 Subject: cpu: Probe points for basic PMU stats This changeset adds probe points that can be used to implement PMU counters for CPU stats. The following probes are supported: * BaseCPU::ppCycles / Cycles * BaseCPU::ppRetiredInsts / RetiredInsts * BaseCPU::ppRetiredLoads / RetiredLoads * BaseCPU::ppRetiredStores / RetiredStores * BaseCPU::ppRetiredBranches RetiredBranches --- src/cpu/simple/atomic.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/cpu/simple/atomic.cc') diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 5af3854e7..d6dbb9292 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -233,7 +233,9 @@ AtomicSimpleCPU::activateContext(ThreadID thread_num) assert(!tickEvent.scheduled()); notIdleFraction = 1; - numCycles += ticksToCycles(thread->lastActivate - thread->lastSuspend); + Cycles delta = ticksToCycles(thread->lastActivate - thread->lastSuspend); + numCycles += delta; + ppCycles->notify(delta); //Make sure ticks are still on multiples of cycles schedule(tickEvent, clockEdge(Cycles(0))); @@ -501,6 +503,7 @@ AtomicSimpleCPU::tick() for (int i = 0; i < width || locked; ++i) { numCycles++; + ppCycles->notify(1); if (!curStaticInst || !curStaticInst->isDelayedCommit()) checkForInterrupts(); @@ -614,6 +617,8 @@ AtomicSimpleCPU::tick() void AtomicSimpleCPU::regProbePoints() { + BaseCPU::regProbePoints(); + ppCommit = new ProbePointArg> (getProbeManager(), "Commit"); } -- cgit v1.2.3