sim: Rename the root stats group to RootStats

Currently, the name of the stats group of thr Root object is
Stats, which is likely to be confused with the Stats namespace.

This commit renames the struct to RootStats. This allows the
Stats namespace to be expressed as `Stats::`, which is
consistent with how the namespace is accessed in other part of
gem5.

Change-Id: Ieb425c3df1f5c0d5f11b1a467a36b2e0e07b2771
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38915
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Hoa Nguyen
2021-01-11 02:29:40 -08:00
parent e19fbe431a
commit fb952a124a
2 changed files with 18 additions and 18 deletions

View File

@@ -49,10 +49,10 @@
#include "sim/root.hh"
Root *Root::_root = NULL;
Root::Stats Root::Stats::instance;
Root::Stats &rootStats = Root::Stats::instance;
Root::RootStats Root::RootStats::instance;
Root::RootStats &rootStats = Root::RootStats::instance;
Root::Stats::Stats()
Root::RootStats::RootStats()
: Stats::Group(nullptr),
simSeconds(this, "sim_seconds", "Number of seconds simulated"),
simTicks(this, "sim_ticks", "Number of ticks simulated"),
@@ -92,7 +92,7 @@ Root::Stats::Stats()
}
void
Root::Stats::resetStats()
Root::RootStats::resetStats()
{
statTime.setTimer();
startTick = curTick();
@@ -180,7 +180,7 @@ Root::Root(const RootParams &p)
// stat formulas. The most convenient way to implement that is by
// having a single global stat group for global stats. Merge that
// group into the root object here.
mergeStatGroup(&Root::Stats::instance);
mergeStatGroup(&Root::RootStats::instance);
}
void

View File

@@ -90,26 +90,26 @@ class Root : public SimObject
}
public: // Global statistics
struct Stats : public ::Stats::Group
struct RootStats : public Stats::Group
{
void resetStats() override;
::Stats::Formula simSeconds;
::Stats::Value simTicks;
::Stats::Value finalTick;
::Stats::Value simFreq;
::Stats::Value hostSeconds;
Stats::Formula simSeconds;
Stats::Value simTicks;
Stats::Value finalTick;
Stats::Value simFreq;
Stats::Value hostSeconds;
::Stats::Formula hostTickRate;
::Stats::Value hostMemory;
Stats::Formula hostTickRate;
Stats::Value hostMemory;
static Stats instance;
static RootStats instance;
private:
Stats();
RootStats();
Stats(const Stats &) = delete;
Stats &operator=(const Stats &) = delete;
RootStats(const RootStats &) = delete;
RootStats &operator=(const RootStats &) = delete;
Time statTime;
Tick startTick;
@@ -151,6 +151,6 @@ class Root : public SimObject
* Global simulator statistics that are not associated with a
* specific SimObject.
*/
extern Root::Stats &rootStats;
extern Root::RootStats &rootStats;
#endif // __SIM_ROOT_HH__