stdlib: Move _m5.stats.processDumpQueue to call-once
This commit addresses Jason's comment (https://github.com/gem5/gem5/pull/996#discussion_r1613870880) which highlighted putting the `_m5.stats.processDumpQueue` call in the iteration through the `root` object in `get_simstat` caused this function be potentially called many times when it only needs to be called once. This chance moved this call to just before this iteration and will tehrefore only be called once (if required) per `get_simstat` execution. Change-Id: I16908b6dee063a0df7877a19e215883963bfb081
This commit is contained in:
@@ -373,6 +373,10 @@ def get_simstat(
|
||||
:Returns: The SimStat Object of the current simulation.
|
||||
|
||||
"""
|
||||
|
||||
if prepare_stats:
|
||||
_m5.stats.processDumpQueue()
|
||||
|
||||
stats_map = {}
|
||||
for r in root:
|
||||
creation_time = datetime.now()
|
||||
@@ -384,9 +388,6 @@ def get_simstat(
|
||||
simulated_begin_time = int(final_tick - sim_ticks)
|
||||
simulated_end_time = int(final_tick)
|
||||
|
||||
if prepare_stats:
|
||||
_m5.stats.processDumpQueue()
|
||||
|
||||
if prepare_stats:
|
||||
if isinstance(r, list):
|
||||
for obj in r:
|
||||
|
||||
Reference in New Issue
Block a user