summaryrefslogtreecommitdiff
path: root/base/stats/events.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-05-23 12:53:34 -0400
committerNathan Binkert <binkertn@umich.edu>2004-05-23 12:53:34 -0400
commit3a0dfc43d19255a04c74ef1b1017e978bc5b8796 (patch)
treecedd703b4501d46e77fbf3e6c91fa245c54f2371 /base/stats/events.cc
parent6cf04bf31e97cde528ad7eee18abdf64fcdfde42 (diff)
downloadgem5-3a0dfc43d19255a04c74ef1b1017e978bc5b8796.tar.xz
make the interaction of the stats event stuff with the
database work better. base/stats/events.cc: properly connect to the database base/stats/mysql.cc: cleanup the event stuff too --HG-- extra : convert_revision : f05fd6456decc9c4f95beff5c12497439e45f886
Diffstat (limited to 'base/stats/events.cc')
-rw-r--r--base/stats/events.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/base/stats/events.cc b/base/stats/events.cc
index 3a858611f..b579981e9 100644
--- a/base/stats/events.cc
+++ b/base/stats/events.cc
@@ -66,11 +66,12 @@ __event(const string &stat)
stat));
MySQL::Result result = mysql.store_result();
- if (result) {
- assert(result.num_fields() == 1);
- MySQL::Row row = result.fetch_row();
- if (!row)
- panic("could not get a run\n%s\n", mysql.error);
+ if (!result)
+ panic("could not get a run\n%s\n", mysql.error);
+
+ assert(result.num_fields() == 1);
+ MySQL::Row row = result.fetch_row();
+ if (row) {
if (!to_number(row[0], event))
panic("invalid event id: %s\n", row[0]);
} else {
@@ -85,7 +86,6 @@ __event(const string &stat)
event = mysql.insert_id();
}
-
} else {
event = (*i).second;
}