From a52dce6d623f6cb289004d4af12be0769966dadf Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 9 Oct 2008 04:58:23 -0700 Subject: style: Bring statistics code in line with the proper style. --- src/base/stats/mysql.hh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/base/stats/mysql.hh') 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 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::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; } -- cgit v1.2.3 From 7cc2a88038ccfd828a0caa7aa9d1b758d096d37d Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 9 Oct 2008 04:58:23 -0700 Subject: stats: use properly signed types for looping and comparison --- src/base/stats/mysql.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/base/stats/mysql.hh') diff --git a/src/base/stats/mysql.hh b/src/base/stats/mysql.hh index 5caac69de..6e47719ce 100644 --- a/src/base/stats/mysql.hh +++ b/src/base/stats/mysql.hh @@ -69,9 +69,9 @@ class InsertData { private: char *query; - int size; + size_type size; bool first; - static const int maxsize = 1024*1024; + static const size_type maxsize = 1024*1024; public: MySqlRun *run; @@ -95,9 +95,9 @@ class InsertEvent { private: char *query; - int size; + size_type size; bool first; - static const int maxsize = 1024*1024; + static const size_type maxsize = 1024*1024; typedef std::map event_map_t; event_map_t events; -- cgit v1.2.3 From fb74987c522a141b2f61d303377453cbbfae0788 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Feb 2009 12:22:15 -0800 Subject: stats: Try to make the names of things more intuitive. Basically, this means renaming several things called data to info, which is information about the statistics. Things that are named data now are actual data stored for the statistic. --- src/base/stats/mysql.hh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/base/stats/mysql.hh') diff --git a/src/base/stats/mysql.hh b/src/base/stats/mysql.hh index 6e47719ce..f0f79bebd 100644 --- a/src/base/stats/mysql.hh +++ b/src/base/stats/mysql.hh @@ -40,7 +40,7 @@ namespace MySQL { class Connection; } namespace Stats { -class DistDataData; +class DistInfoBase; class MySqlRun; struct SetupStat @@ -121,7 +121,7 @@ class MySql : public Output SetupStat stat; InsertData newdata; InsertEvent newevent; - std::list formulas; + std::list formulas; bool configured; protected: @@ -155,12 +155,12 @@ class MySql : public Output public: // Implement Visit - virtual void visit(const ScalarData &data); - virtual void visit(const VectorData &data); - virtual void visit(const DistData &data); - virtual void visit(const VectorDistData &data); - virtual void visit(const Vector2dData &data); - virtual void visit(const FormulaData &data); + virtual void visit(const ScalarInfoBase &info); + virtual void visit(const VectorInfoBase &info); + virtual void visit(const DistInfoBase &info); + virtual void visit(const VectorDistInfoBase &info); + virtual void visit(const Vector2dInfoBase &info); + virtual void visit(const FormulaInfoBase &info); // Implement Output virtual bool valid() const; @@ -171,22 +171,22 @@ class MySql : public Output protected: // Output helper - void output(const DistDataData &data); - void output(const ScalarData &data); - void output(const VectorData &data); + void output(const ScalarInfoBase &info); + void output(const VectorInfoBase &info); + void output(const DistInfoBase &info); + void output(const VectorDistInfoBase &info); + void output(const Vector2dInfoBase &info); + void output(const FormulaInfoBase &info); void output(const DistData &data); - void output(const VectorDistData &data); - void output(const Vector2dData &data); - void output(const FormulaData &data); void configure(); - bool configure(const StatData &data, std::string type); - void configure(const ScalarData &data); - void configure(const VectorData &data); - void configure(const DistData &data); - void configure(const VectorDistData &data); - void configure(const Vector2dData &data); - void configure(const FormulaData &data); + bool configure(const Info &info, std::string type); + void configure(const ScalarInfoBase &info); + void configure(const VectorInfoBase &info); + void configure(const DistInfoBase &info); + void configure(const VectorDistInfoBase &info); + void configure(const Vector2dInfoBase &info); + void configure(const FormulaInfoBase &info); }; bool initMySQL(std::string host, std::string database, std::string user, -- cgit v1.2.3 From fcaf1b74b0b4b40891a71b3b8bccd3f173aeff56 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 7 Mar 2009 14:30:53 -0800 Subject: stats: cleanup text output stuff and fix mysql output --- src/base/stats/mysql.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/base/stats/mysql.hh') diff --git a/src/base/stats/mysql.hh b/src/base/stats/mysql.hh index f0f79bebd..86a4d6d23 100644 --- a/src/base/stats/mysql.hh +++ b/src/base/stats/mysql.hh @@ -56,6 +56,7 @@ struct SetupStat bool total; bool pdf; bool cdf; + double min; double max; double bktsize; @@ -177,7 +178,7 @@ class MySql : public Output void output(const VectorDistInfoBase &info); void output(const Vector2dInfoBase &info); void output(const FormulaInfoBase &info); - void output(const DistData &data); + void output(const DistData &data, const DistParams *params); void configure(); bool configure(const Info &info, std::string type); -- cgit v1.2.3