summaryrefslogtreecommitdiff
path: root/src/base/stats/mysql.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-02-21 10:15:17 -0800
committerNathan Binkert <binkertn@umich.edu>2007-02-21 10:15:17 -0800
commit3fb3616be4bc68c15aa67df0b93d6b0f790acd16 (patch)
tree170fe7e85bbaaa8a8424c5cec126a2b4004186d0 /src/base/stats/mysql.hh
parent5000c4d878f9bee395a593f450adcf85267e320f (diff)
downloadgem5-3fb3616be4bc68c15aa67df0b93d6b0f790acd16.tar.xz
Fix majory brokenness in my previous MySQL commit, basically
this is just a shuffling around of code and fixes to make stuff commit properly --HG-- extra : convert_revision : a057f7fe4962cfc6200781ff66d2c26bf9c6eb8c
Diffstat (limited to 'src/base/stats/mysql.hh')
-rw-r--r--src/base/stats/mysql.hh31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/base/stats/mysql.hh b/src/base/stats/mysql.hh
index a43c74ecc..52f93ac61 100644
--- a/src/base/stats/mysql.hh
+++ b/src/base/stats/mysql.hh
@@ -62,7 +62,7 @@ struct SetupStat
uint16_t size;
void init();
- unsigned setup();
+ unsigned setup(MySqlRun *run);
};
class InsertData
@@ -84,13 +84,34 @@ class InsertData
int16_t y;
public:
- InsertData();
+ InsertData(MySqlRun *_run);
~InsertData();
void flush();
void insert();
};
+class InsertEvent
+{
+ private:
+ char *query;
+ int size;
+ bool first;
+ static const int maxsize = 1024*1024;
+
+ typedef std::map<std::string, uint32_t> event_map_t;
+ event_map_t events;
+
+ MySqlRun *run;
+
+ public:
+ InsertEvent(MySqlRun *_run);
+ ~InsertEvent();
+
+ void flush();
+ void insert(const std::string &stat);
+};
+
class MySql : public Output
{
protected:
@@ -99,6 +120,7 @@ class MySql : public Output
SetupStat stat;
InsertData newdata;
+ InsertEvent newevent;
std::list<FormulaData *> formulas;
bool configured;
@@ -120,7 +142,7 @@ class MySql : public Output
}
public:
- MySql(MySqlRun &_run){}
+ MySql();
~MySql();
void connect(const std::string &host, const std::string &user,
@@ -142,6 +164,9 @@ class MySql : public Output
virtual bool valid() const;
virtual void output();
+ // Implement Event Output
+ virtual void event(const std::string &event);
+
protected:
// Output helper
void output(const DistDataData &data);