diff options
author | Nathan Binkert <nate@binkert.org> | 2008-10-09 04:58:23 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2008-10-09 04:58:23 -0700 |
commit | a52dce6d623f6cb289004d4af12be0769966dadf (patch) | |
tree | 9edabd04f76bd4ae3f39f00c149edc2642457aaf /src/base/stats | |
parent | b66eb3b8d1e759bacb55ef187541f4c37767241a (diff) | |
download | gem5-a52dce6d623f6cb289004d4af12be0769966dadf.tar.xz |
style: Bring statistics code in line with the proper style.
Diffstat (limited to 'src/base/stats')
-rw-r--r-- | src/base/stats/events.cc | 2 | ||||
-rw-r--r-- | src/base/stats/flags.hh | 1 | ||||
-rw-r--r-- | src/base/stats/mysql.cc | 2 | ||||
-rw-r--r-- | src/base/stats/mysql.hh | 20 | ||||
-rw-r--r-- | src/base/stats/mysql_run.hh | 8 | ||||
-rw-r--r-- | src/base/stats/statdb.cc | 3 | ||||
-rw-r--r-- | src/base/stats/text.cc | 10 | ||||
-rw-r--r-- | src/base/stats/types.hh | 1 |
8 files changed, 25 insertions, 22 deletions
diff --git a/src/base/stats/events.cc b/src/base/stats/events.cc index dc56fe75f..dcf52e6d8 100644 --- a/src/base/stats/events.cc +++ b/src/base/stats/events.cc @@ -38,7 +38,7 @@ using namespace std; namespace Stats { -Tick EventStart = ULL(0x7fffffffffffffff); +Tick EventStart = MaxTick; extern list<Output *> OutputList; diff --git a/src/base/stats/flags.hh b/src/base/stats/flags.hh index b8b0171ed..77eedaee8 100644 --- a/src/base/stats/flags.hh +++ b/src/base/stats/flags.hh @@ -30,6 +30,7 @@ #ifndef __BASE_STATS_FLAGS_HH__ #define __BASE_STATS_FLAGS_HH__ + namespace Stats { /** diff --git a/src/base/stats/mysql.cc b/src/base/stats/mysql.cc index ee15d4231..c3498dc60 100644 --- a/src/base/stats/mysql.cc +++ b/src/base/stats/mysql.cc @@ -930,7 +930,7 @@ MySql::visit(const FormulaData &data) bool initMySQL(string host, string user, string password, string database, - string project, string name, string sample) + string project, string name, string sample) { extern list<Output *> OutputList; static MySql mysql; diff --git a/src/base/stats/mysql.hh b/src/base/stats/mysql.hh index 0ce381c2f..5caac69de 100644 --- a/src/base/stats/mysql.hh +++ b/src/base/stats/mysql.hh @@ -127,13 +127,15 @@ class MySql : public Output protected: std::map<int, int> idmap; - void insert(int sim_id, int db_id) + void + insert(int sim_id, int db_id) { using namespace std; idmap.insert(make_pair(sim_id, db_id)); } - int find(int sim_id) + int + find(int sim_id) { using namespace std; map<int,int>::const_iterator i = idmap.find(sim_id); @@ -146,9 +148,9 @@ class MySql : public Output ~MySql(); void connect(const std::string &host, const std::string &user, - const std::string &passwd, const std::string &db, - const std::string &name, const std::string &sample, - const std::string &project); + const std::string &passwd, const std::string &db, + const std::string &name, const std::string &sample, + const std::string &project); bool connected() const; public: @@ -188,14 +190,14 @@ class MySql : public Output }; bool initMySQL(std::string host, std::string database, std::string user, - std::string passwd, std::string project, std::string name, - std::string sample); + std::string passwd, std::string project, std::string name, + std::string sample); #if !USE_MYSQL inline bool initMySQL(std::string host, std::string user, std::string password, - std::string database, std::string project, std::string name, - std::string sample) + std::string database, std::string project, std::string name, + std::string sample) { return false; } diff --git a/src/base/stats/mysql_run.hh b/src/base/stats/mysql_run.hh index 487224551..7c606370e 100644 --- a/src/base/stats/mysql_run.hh +++ b/src/base/stats/mysql_run.hh @@ -46,7 +46,7 @@ struct MySqlRun protected: void setup(const std::string &name, const std::string &sample, - const std::string &user, const std::string &project); + const std::string &user, const std::string &project); void remove(const std::string &name); void cleanup(); @@ -54,9 +54,9 @@ struct MySqlRun public: bool connected() const { return mysql.connected(); } void connect(const std::string &host, const std::string &user, - const std::string &passwd, const std::string &db, - const std::string &name, const std::string &sample, - const std::string &project); + const std::string &passwd, const std::string &db, + const std::string &name, const std::string &sample, + const std::string &project); MySQL::Connection &conn() { return mysql; } uint16_t run() const { return run_id; } diff --git a/src/base/stats/statdb.cc b/src/base/stats/statdb.cc index f9136807a..c54dbb8ec 100644 --- a/src/base/stats/statdb.cc +++ b/src/base/stats/statdb.cc @@ -73,7 +73,8 @@ regPrint(void *stat) data->flags |= print; } -TheDatabase &db() +TheDatabase & +db() { static TheDatabase db; return db; diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index f65b77777..a39bfe242 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -447,7 +447,6 @@ DistPrint::operator()(ostream &stream) const print(stream); } - if (!compat) { for (int i = 0; i < size; ++i) { stringstream namestr; @@ -467,7 +466,6 @@ DistPrint::operator()(ostream &stream) const } print(stream); } - } else { Counter _min; Result _pdf; @@ -633,7 +631,8 @@ Text::visit(const Vector2dData &data) super_total += yvec[j]; } - print.name = data.name + "_" + (havesub ? data.subnames[i] : to_string(i)); + print.name = data.name + "_" + + (havesub ? data.subnames[i] : to_string(i)); print.desc = data.desc; print.vec = yvec; print.total = total; @@ -693,8 +692,8 @@ Text::visit(const VectorDistData &data) for (int i = 0; i < data.size(); ++i) { DistPrint print; - print.name = data.name + - (data.subnames[i].empty() ? ("_" + to_string(i)) : data.subnames[i]); + print.name = data.name + "_" + + (data.subnames[i].empty() ? (to_string(i)) : data.subnames[i]); print.desc = data.subdescs[i].empty() ? data.desc : data.subdescs[i]; print.flags = data.flags; print.compat = compat; @@ -748,5 +747,4 @@ initText(const string &filename, bool desc, bool compat) return true; } - /* namespace Stats */ } diff --git a/src/base/stats/types.hh b/src/base/stats/types.hh index b64e8fb17..1ae29afbd 100644 --- a/src/base/stats/types.hh +++ b/src/base/stats/types.hh @@ -32,6 +32,7 @@ #define __BASE_STATS_TYPES_HH__ #include <vector> + #include "sim/host.hh" namespace Stats { |