summaryrefslogtreecommitdiff
path: root/base/stats/events.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-07-30 10:47:53 -0400
committerNathan Binkert <binkertn@umich.edu>2004-07-30 10:47:53 -0400
commit3711ea7347b02b8e27f5959d453cb8c9a291a753 (patch)
tree1c03f48fd8b32020d60e34f7518f9f77e48431bf /base/stats/events.cc
parent41988a86b56984e19e9ef45991a39c00fdb3f21e (diff)
downloadgem5-3711ea7347b02b8e27f5959d453cb8c9a291a753.tar.xz
Move all of the object matching code to a shared file so it can
be more easily re-used. This currently uses some cooked up matching function that I wrote a while ago, but should probably be changed to use regular expressions in the future. add doDebugBreak to control breakpoints on a per SimObject basis SConscript: add match base/stats/events.cc: base/trace.cc: Move the object matching code into a separate file so it can be more easily shared base/trace.hh: the object matching code was wrapped up and moved. adapt. sim/sim_object.cc: add the doDebugBreak flag that can be set on a per-SimObject basis. This will be used in the future to control whether or not debug_break() will actually break for a given object. provide a function interface that can be called from the debugger. sim/sim_object.hh: add the doDebugBreak flag that can be set on a per-SimObject basis. This will be used in the future to control whether or not debug_break() will actually break for a given object. --HG-- extra : convert_revision : 6bf7924de63d41f5ba6b80d579efdf26ba265a8f
Diffstat (limited to 'base/stats/events.cc')
-rw-r--r--base/stats/events.cc36
1 files changed, 3 insertions, 33 deletions
diff --git a/base/stats/events.cc b/base/stats/events.cc
index 771927564..b583e5936 100644
--- a/base/stats/events.cc
+++ b/base/stats/events.cc
@@ -37,8 +37,9 @@
#include "base/stats/mysql_run.hh"
#endif
-#include "base/str.hh"
+#include "base/match.hh"
#include "sim/host.hh"
+#include "sim/sim_object.hh"
#include "sim/universe.hh"
using namespace std;
@@ -47,38 +48,7 @@ namespace Stats {
Tick EventStart = ULL(0x7fffffffffffffff);
-vector<string> event_ignore;
-vector<vector<string> > ignore_tokens;
-vector<int> ignore_size;
-int event_ignore_size;
-
-bool
-ignoreEvent(const string &name)
-{
- vector<string> name_tokens;
- tokenize(name_tokens, name, '.');
- int ntsize = name_tokens.size();
-
- for (int i = 0; i < event_ignore_size; ++i) {
- bool match = true;
- int jstop = ignore_size[i];
- for (int j = 0; j < jstop; ++j) {
- if (j >= ntsize)
- break;
-
- const string &ignore = ignore_tokens[i][j];
- if (ignore != "*" && ignore != name_tokens[j]) {
- match = false;
- break;
- }
- }
-
- if (match == true)
- return true;
- }
-
- return false;
-}
+ObjectMatch event_ignore;
#ifdef USE_MYSQL
class InsertEvent