stats: track if the stats have been enabled and prevent requesting master id
Track the point in the initialization where statistics have been registered. After this point registering new masterIds can no longer work as some SimObjects may have sized stats vectors based on the previous value. If someone tries to register a masterId after this point the simulator executes fatal().
This commit is contained in:
@@ -82,6 +82,8 @@ def enable():
|
||||
stats_dict[stat.name] = stat
|
||||
stat.enable()
|
||||
|
||||
internal.stats.enable();
|
||||
|
||||
def prepare():
|
||||
'''Prepare all stats for data access. This must be done before
|
||||
dumping and serialization.'''
|
||||
|
||||
@@ -146,6 +146,8 @@ void schedStatEvent(bool dump, bool reset,
|
||||
Tick when = curTick(), Tick repeat = 0);
|
||||
|
||||
void processResetQueue();
|
||||
void enable();
|
||||
bool enabled();
|
||||
|
||||
std::list<Info *> &statsList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user