From: Hoa Nguyen Date: Mon, 11 Jan 2021 10:29:40 +0000 (-0800) Subject: sim: Rename the root stats group to RootStats X-Git-Tag: develop-gem5-snapshot~292 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb952a124aac92aab520cb485f1295cbe211d271;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38915 Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/sim/root.cc b/src/sim/root.cc index d9098a671..7ca84bf8c 100644 --- a/src/sim/root.cc +++ b/src/sim/root.cc @@ -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 diff --git a/src/sim/root.hh b/src/sim/root.hh index fa152ff2d..817e2f334 100644 --- a/src/sim/root.hh +++ b/src/sim/root.hh @@ -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__