instTraceStream(nullptr),
startTraceInst(params->startTraceInst),
allProbesReg(false),
- traceVirtAddr(params->traceVirtAddr)
+ traceVirtAddr(params->traceVirtAddr),
+ stats(this)
{
cpu = dynamic_cast<FullO3CPU<O3CPUImpl>*>(params->manager);
fatal_if(!cpu, "Manager of %s is not of type O3CPU and thus does not "\
}
exec_info_ptr->executeTick = curTick();
- maxTempStoreSize = std::max(tempStore.size(),
- (std::size_t)maxTempStoreSize.value());
+ stats.maxTempStoreSize = std::max(tempStore.size(),
+ (std::size_t)stats.maxTempStoreSize.value());
}
void
physRegDepMap[phys_dest_reg->flatIndex()] = seq_num;
}
}
- maxPhysRegDepMapSize = std::max(physRegDepMap.size(),
- (std::size_t)maxPhysRegDepMapSize.value());
+ stats.maxPhysRegDepMapSize = std::max(physRegDepMap.size(),
+ (std::size_t)stats.maxPhysRegDepMapSize.value());
}
void
TraceInfo* reg_dep = trace_info_itr->second;
reg_dep->numDepts++;
compDelayPhysRegDep(reg_dep, new_record);
- ++numRegDep;
+ ++stats.numRegDep;
} else {
// The instruction that this has a register dependency on was
// not added to the trace because of one of the following
if (hasLoadCompleted(past_record, execute_tick)) {
// Assign rob dependency and calculate the computational delay
assignRobDep(past_record, new_record);
- ++numOrderDepStores;
+ ++stats.numRegDep;
return;
}
} else {
if (hasStoreCommitted(past_record, execute_tick)) {
// Assign rob dependency and calculate the computational delay
assignRobDep(past_record, new_record);
- ++numOrderDepStores;
+ ++stats.numRegDep;
return;
}
}
if (new_record->isLoad()) {
// The execution time of a load is when a request is sent
execute_tick = new_record->executeTick;
- ++numIssueOrderDepLoads;
+ ++stats.numIssueOrderDepLoads;
} else if (new_record->isStore()) {
// The execution time of a store is when it is sent, i.e. committed
execute_tick = curTick();
- ++numIssueOrderDepStores;
+ ++stats.numIssueOrderDepStores;
} else {
// The execution time of a non load/store is when it completes
execute_tick = new_record->toCommitTick;
- ++numIssueOrderDepOther;
+ ++stats.numIssueOrderDepOther;
}
// We search if this record has an issue order dependency on a past record.
// Increment number of dependents of the past record
++(past_record->numDepts);
// Update stat to log max number of dependents
- maxNumDependents = std::max(past_record->numDepts,
- (uint32_t)maxNumDependents.value());
+ stats.maxNumDependents = std::max(past_record->numDepts,
+ (uint32_t)stats.maxNumDependents.value());
}
bool
} else {
// Don't write the node to the trace but note that we have filtered
// out a node.
- ++numFilteredNodes;
+ ++stats.numFilteredNodes;
++num_filtered_nodes;
}
dep_trace_itr++;
depTrace.erase(dep_trace_itr_start, dep_trace_itr);
}
-void
-ElasticTrace::regStats() {
- ProbeListenerObject::regStats();
-
- using namespace Stats;
- numRegDep
- .name(name() + ".numRegDep")
- .desc("Number of register dependencies recorded during tracing")
- ;
-
- numOrderDepStores
- .name(name() + ".numOrderDepStores")
- .desc("Number of commit order (rob) dependencies for a store recorded"
- " on a past load/store during tracing")
- ;
-
- numIssueOrderDepLoads
- .name(name() + ".numIssueOrderDepLoads")
- .desc("Number of loads that got assigned issue order dependency"
- " because they were dependency-free")
- ;
-
- numIssueOrderDepStores
- .name(name() + ".numIssueOrderDepStores")
- .desc("Number of stores that got assigned issue order dependency"
- " because they were dependency-free")
- ;
-
- numIssueOrderDepOther
- .name(name() + ".numIssueOrderDepOther")
- .desc("Number of non load/store insts that got assigned issue order"
- " dependency because they were dependency-free")
- ;
-
- numFilteredNodes
- .name(name() + ".numFilteredNodes")
- .desc("No. of nodes filtered out before writing the output trace")
- ;
-
- maxNumDependents
- .name(name() + ".maxNumDependents")
- .desc("Maximum number or dependents on any instruction")
- ;
-
- maxTempStoreSize
- .name(name() + ".maxTempStoreSize")
- .desc("Maximum size of the temporary store during the run")
- ;
-
- maxPhysRegDepMapSize
- .name(name() + ".maxPhysRegDepMapSize")
- .desc("Maximum size of register dependency map")
- ;
+ElasticTrace::ElasticTraceStats::ElasticTraceStats(Stats::Group *parent)
+ : Stats::Group(parent),
+ ADD_STAT(numRegDep, "Number of register dependencies recorded during"
+ " tracing"),
+ ADD_STAT(numOrderDepStores, "Number of commit order (rob) dependencies"
+ " for a store recorded on a past load/store during tracing"),
+ ADD_STAT(numIssueOrderDepLoads, "Number of loads that got assigned"
+ " issue order dependency because they were dependency-free"),
+ ADD_STAT(numIssueOrderDepStores, "Number of stores that got assigned"
+ " issue order dependency because they were dependency-free"),
+ ADD_STAT(numIssueOrderDepOther, "Number of non load/store insts that"
+ " got assigned issue order dependency because they were"
+ " dependency-free"),
+ ADD_STAT(numFilteredNodes, "No. of nodes filtered out before writing"
+ " the output trace"),
+ ADD_STAT(maxNumDependents, "Maximum number or dependents on any"
+ " instruction"),
+ ADD_STAT(maxTempStoreSize, "Maximum size of the temporary store during"
+ " the run"),
+ ADD_STAT(maxPhysRegDepMapSize, "Maximum size of register dependency map")
+{
}
const std::string&
*/
void addCommittedInst(const DynInstConstPtr& head_inst);
- /** Register statistics for the elastic trace. */
- void regStats();
-
/** Event to trigger registering this listener for all probe points. */
EventFunctionWrapper regEtraceListenersEvent;
*/
bool hasCompCompleted(TraceInfo* past_record, Tick execute_tick) const;
- /** Number of register dependencies recorded during tracing */
- Stats::Scalar numRegDep;
+ struct ElasticTraceStats : public Stats::Group {
+ ElasticTraceStats(Stats::Group *parent);
- /**
- * Number of stores that got assigned a commit order dependency
- * on a past load/store.
- */
- Stats::Scalar numOrderDepStores;
+ /** Number of register dependencies recorded during tracing */
+ Stats::Scalar numRegDep;
- /**
- * Number of load insts that got assigned an issue order dependency
- * because they were dependency-free.
- */
- Stats::Scalar numIssueOrderDepLoads;
+ /**
+ * Number of stores that got assigned a commit order dependency
+ * on a past load/store.
+ */
+ Stats::Scalar numOrderDepStores;
- /**
- * Number of store insts that got assigned an issue order dependency
- * because they were dependency-free.
- */
- Stats::Scalar numIssueOrderDepStores;
+ /**
+ * Number of load insts that got assigned an issue order dependency
+ * because they were dependency-free.
+ */
+ Stats::Scalar numIssueOrderDepLoads;
- /**
- * Number of non load/store insts that got assigned an issue order
- * dependency because they were dependency-free.
- */
- Stats::Scalar numIssueOrderDepOther;
+ /**
+ * Number of store insts that got assigned an issue order dependency
+ * because they were dependency-free.
+ */
+ Stats::Scalar numIssueOrderDepStores;
- /** Number of filtered nodes */
- Stats::Scalar numFilteredNodes;
+ /**
+ * Number of non load/store insts that got assigned an issue order
+ * dependency because they were dependency-free.
+ */
+ Stats::Scalar numIssueOrderDepOther;
- /** Maximum number of dependents on any instruction */
- Stats::Scalar maxNumDependents;
+ /** Number of filtered nodes */
+ Stats::Scalar numFilteredNodes;
- /**
- * Maximum size of the temporary store mostly useful as a check that it is
- * not growing
- */
- Stats::Scalar maxTempStoreSize;
+ /** Maximum number of dependents on any instruction */
+ Stats::Scalar maxNumDependents;
- /**
- * Maximum size of the map that holds the last writer to a physical
- * register.
- * */
- Stats::Scalar maxPhysRegDepMapSize;
+ /**
+ * Maximum size of the temporary store mostly useful as a check that
+ * it is not growing
+ */
+ Stats::Scalar maxTempStoreSize;
+
+ /**
+ * Maximum size of the map that holds the last writer to a physical
+ * register.
+ */
+ Stats::Scalar maxPhysRegDepMapSize;
+ } stats;
};
#endif//__CPU_O3_PROBE_ELASTIC_TRACE_HH__