summaryrefslogtreecommitdiff
path: root/base/stats
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-06-28 15:53:06 -0400
committerNathan Binkert <binkertn@umich.edu>2004-06-28 15:53:06 -0400
commitefd119881a3cf24902b8a073492a5ba57e5f3a83 (patch)
tree0c30e4fc7806d691d0bbc7519ebed9093043b01c /base/stats
parent75ed8090bf34c38123c779a7f040108268d32a1b (diff)
downloadgem5-efd119881a3cf24902b8a073492a5ba57e5f3a83.tar.xz
add support to add a string to indicate a particular sample of a run
name to make statistical sampling easier. --HG-- extra : convert_revision : b24db4ef747b8ef00a0131db237e97de60c27dc3
Diffstat (limited to 'base/stats')
-rw-r--r--base/stats/mysql.cc14
-rw-r--r--base/stats/mysql_run.hh7
2 files changed, 12 insertions, 9 deletions
diff --git a/base/stats/mysql.cc b/base/stats/mysql.cc
index 42f68811b..4c2a60127 100644
--- a/base/stats/mysql.cc
+++ b/base/stats/mysql.cc
@@ -57,7 +57,8 @@ MySqlConnected()
void
MySqlRun::connect(const string &host, const string &user, const string &passwd,
- const string &db, const string &name, const string &project)
+ const string &db, const string &name, const string &sample,
+ const string &project)
{
if (connected())
panic("can only get one database connection at this time!");
@@ -68,21 +69,22 @@ MySqlRun::connect(const string &host, const string &user, const string &passwd,
remove(name);
cleanup();
- setup(name, user, project);
+ setup(name, sample, user, project);
}
void
-MySqlRun::setup(const string &name, const string &user, const string &project)
+MySqlRun::setup(const string &name, const string &sample, const string &user,
+ const string &project)
{
assert(mysql.connected());
stringstream insert;
ccprintf(insert,
"INSERT INTO "
- "runs(rn_name, rn_user, rn_project, rn_date, rn_expire)"
- "values(\"%s\", \"%s\", \"%s\", NOW(),"
+ "runs(rn_name,rn_sample,rn_user,rn_project,rn_date,rn_expire)"
+ "values(\"%s\", \"%s\", \"%s\", \"%s\", NOW(),"
"DATE_ADD(CURDATE(), INTERVAL 31 DAY))",
- name, user, project);
+ name, sample, user, project);
mysql.query(insert);
if (mysql.error)
diff --git a/base/stats/mysql_run.hh b/base/stats/mysql_run.hh
index 0f8d84297..3e19a184e 100644
--- a/base/stats/mysql_run.hh
+++ b/base/stats/mysql_run.hh
@@ -46,10 +46,11 @@ struct MySqlRun
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 &project);
+ const std::string &name, const std::string &sample,
+ const std::string &project);
- void setup(const std::string &name, const std::string &user,
- const std::string &project);
+ void setup(const std::string &name, const std::string &sample,
+ const std::string &user, const std::string &project);
void remove(const std::string &name);
void cleanup();