diff options
author | Nathan Binkert <binkertn@umich.edu> | 2007-02-17 22:52:32 -0800 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2007-02-17 22:52:32 -0800 |
commit | e94103397c58ffe05d4c5c7f536edabfb1d6861b (patch) | |
tree | 9109a4c2f22b3681c48ab6047c3223e70297db12 /src/base/stats/mysql.hh | |
parent | 01f32efa4b3c25ad6323ec3e76d756b442a8f419 (diff) | |
download | gem5-e94103397c58ffe05d4c5c7f536edabfb1d6861b.tar.xz |
Get rid of the Statistics and Statreset ParamContexts, and
expose all of the relevant functionality to python. Clean
up the mysql code while we're at it.
--HG--
extra : convert_revision : 5b711202a5a452b8875ebefb136a156b65c24279
Diffstat (limited to 'src/base/stats/mysql.hh')
-rw-r--r-- | src/base/stats/mysql.hh | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/base/stats/mysql.hh b/src/base/stats/mysql.hh index 50f7d9e97..a43c74ecc 100644 --- a/src/base/stats/mysql.hh +++ b/src/base/stats/mysql.hh @@ -35,14 +35,13 @@ #include <string> #include "base/stats/output.hh" +#include "config/use_mysql.hh" namespace MySQL { class Connection; } namespace Stats { class DistDataData; class MySqlRun; -bool MySqlConnected(); -extern MySqlRun MySqlDB; struct SetupStat { @@ -95,6 +94,9 @@ class InsertData class MySql : public Output { protected: + MySqlRun *run; /* Hide the implementation so we don't have a + #include mess */ + SetupStat stat; InsertData newdata; std::list<FormulaData *> formulas; @@ -116,6 +118,17 @@ class MySql : public Output assert(i != idmap.end()); return (*i).second; } + + public: + MySql(MySqlRun &_run){} + ~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); + bool connected() const; + public: // Implement Visit virtual void visit(const ScalarData &data); @@ -149,6 +162,20 @@ class MySql : public Output void configure(const FormulaData &data); }; +bool initMySQL(std::string host, std::string database, std::string user = "", + std::string passwd = "", std::string name = "test", + std::string sample = "0", std::string project = "test"); + +#if !USE_MYSQL +inline bool +initMySQL(std::string host, std::string user, std::string password, + std::string database, std::string name, std::string sample, + std::string project) +{ + return false; +} +#endif + /* namespace Stats */ } #endif // __BASE_STATS_MYSQL_HH__ |