util: Rename recently renamed namespaces

These namespaces were recently renamed, but the
renames were not applied here.

Change-Id: I3093f193e835f81e1beca538cbca6a0751f6c21b
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46541
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-06-04 19:44:59 -03:00
committed by Daniel Carvalho
parent 89e36417d4
commit 2f8a8508fb
11 changed files with 70 additions and 56 deletions

View File

@@ -113,8 +113,8 @@ main(int argc, char **argv)
setClockFrequency(1000000000000);
curEventQueue(getEventQueue(0));
Stats::initSimStats();
Stats::registerHandlers(CxxConfig::statsReset, CxxConfig::statsDump);
statistics::initSimStats();
statistics::registerHandlers(CxxConfig::statsReset, CxxConfig::statsDump);
Trace::enable();
setDebugFlag("Terminal");
@@ -291,7 +291,7 @@ main(int argc, char **argv)
} while (drain_count > 0);
old_cpu.switchOut();
system.setMemoryMode(Enums::timing);
system.setMemoryMode(enums::timing);
new_cpu.takeOverFrom(&old_cpu);
config_manager->drainResume();

View File

@@ -40,9 +40,12 @@
*
* C++-only configuration stats handling example
*
* Register with: Stats::registerHandlers(statsReset, statsDump)
* Register with: statistics::registerHandlers(statsReset, statsDump)
*/
#include <iostream>
#include <list>
#include "base/statistics.hh"
#include "stats.hh"
@@ -51,7 +54,7 @@ namespace CxxConfig
void statsPrepare()
{
std::list<Stats::Info *> stats = Stats::statsList();
std::list<statistics::Info *> stats = statistics::statsList();
/* gather_stats -> prepare */
for (auto i = stats.begin(); i != stats.end(); ++i)
@@ -62,24 +65,26 @@ void statsDump()
{
std::cerr << "Stats dump\n";
Stats::processDumpQueue();
statistics::processDumpQueue();
std::list<Stats::Info *> stats = Stats::statsList();
std::list<statistics::Info *> stats = statistics::statsList();
statsPrepare();
/* gather_stats -> convert_value */
for (auto i = stats.begin(); i != stats.end(); ++i) {
Stats::Info *stat = *i;
statistics::Info *stat = *i;
Stats::ScalarInfo *scalar = dynamic_cast<Stats::ScalarInfo *>(stat);
Stats::VectorInfo *vector = dynamic_cast<Stats::VectorInfo *>(stat);
statistics::ScalarInfo *scalar =
dynamic_cast<statistics::ScalarInfo *>(stat);
statistics::VectorInfo *vector =
dynamic_cast<statistics::VectorInfo *>(stat);
if (scalar) {
std::cerr << "SCALAR " << stat->name << ' '
<< scalar->value() << '\n';
} else if (vector) {
Stats::VResult results = vector->value();
statistics::VResult results = vector->value();
unsigned int index = 0;
for (auto e = results.begin(); e != results.end(); ++e) {
@@ -99,12 +104,12 @@ void statsReset()
{
std::cerr << "Stats reset\n";
Stats::processResetQueue();
statistics::processResetQueue();
}
void statsEnable()
{
std::list<Stats::Info *> stats = Stats::statsList();
std::list<statistics::Info *> stats = statistics::statsList();
for (auto i = stats.begin(); i != stats.end(); ++i)
(*i)->enable();

View File

@@ -40,7 +40,7 @@
*
* C++-only configuration stats handling example
*
* Register with: Stats::registerHandlers(statsReset, statsDump)
* Register with: statistics::registerHandlers(statsReset, statsDump)
*/
#ifndef __UTIL_CXX_CONFIG_STATS_H__