summaryrefslogtreecommitdiff
path: root/src/sim/system.hh
diff options
context:
space:
mode:
authorPrakash Ramrakhyani <Prakash.Ramrakhyani@arm.com>2012-01-09 18:08:20 -0600
committerPrakash Ramrakhyani <Prakash.Ramrakhyani@arm.com>2012-01-09 18:08:20 -0600
commit51aa7e4a0392d5e8f98bd7a4d09f4026dd21bd0a (patch)
tree4a93fd0bdfd9e4403053e10ac329500649216f08 /src/sim/system.hh
parent525d1e46dcb3180c8d73996adc025ce255575bd7 (diff)
downloadgem5-51aa7e4a0392d5e8f98bd7a4d09f4026dd21bd0a.tar.xz
sim: Enable sampling of run-time for code-sections marked using pseudo insts.
This patch adds a mechanism to collect run time samples for specific portions of a benchmark, using work_begin and work_end pseudo instructions.It also enhances the histogram stat to report geometric mean.
Diffstat (limited to 'src/sim/system.hh')
-rw-r--r--src/sim/system.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sim/system.hh b/src/sim/system.hh
index ed5193dfd..44383c399 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -171,14 +171,16 @@ class System : public SimObject
Enums::MemoryMode memoryMode;
uint64_t workItemsBegin;
uint64_t workItemsEnd;
+ uint32_t numWorkIds;
std::vector<bool> activeCpus;
public:
+ virtual void regStats();
/**
* Called by pseudo_inst to track the number of work items started by this
* system.
*/
- uint64_t
+ uint64_t
incWorkItemsBegin()
{
return ++workItemsBegin;
@@ -212,6 +214,14 @@ class System : public SimObject
return count;
}
+ inline void workItemBegin(uint32_t tid, uint32_t workid)
+ {
+ std::pair<uint32_t,uint32_t> p(tid, workid);
+ lastWorkItemStarted[p] = curTick();
+ }
+
+ void workItemEnd(uint32_t tid, uint32_t workid);
+
#if FULL_SYSTEM
/**
* Fix up an address used to match PCs for hooking simulator
@@ -303,6 +313,8 @@ class System : public SimObject
public:
Counter totalNumInsts;
EventQueue instEventQueue;
+ std::map<std::pair<uint32_t,uint32_t>, Tick> lastWorkItemStarted;
+ std::map<uint32_t, Stats::Histogram*> workItemStats;
////////////////////////////////////////////
//