summaryrefslogtreecommitdiff
path: root/src/base/trace.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-04-15 10:44:32 -0700
committerNathan Binkert <nate@binkert.org>2011-04-15 10:44:32 -0700
commiteddac53ff60c579eff28134bde84783fe36d6214 (patch)
tree9095c6b64a6fdabf4e0d00b2c8f2ca40ad495f49 /src/base/trace.cc
parentf946d7bcdb4d0b4327857d319dd4ecdd1c320d62 (diff)
downloadgem5-eddac53ff60c579eff28134bde84783fe36d6214.tar.xz
trace: reimplement the DTRACE function so it doesn't use a vector
At the same time, rename the trace flags to debug flags since they have broader usage than simply tracing. This means that --trace-flags is now --debug-flags and --trace-help is now --debug-help
Diffstat (limited to 'src/base/trace.cc')
-rw-r--r--src/base/trace.cc63
1 files changed, 1 insertions, 62 deletions
diff --git a/src/base/trace.cc b/src/base/trace.cc
index 7783b6d42..1a035d400 100644
--- a/src/base/trace.cc
+++ b/src/base/trace.cc
@@ -32,9 +32,7 @@
#include <cctype>
#include <fstream>
#include <iostream>
-#include <list>
#include <string>
-#include <vector>
#include "base/misc.hh"
#include "base/output.hh"
@@ -45,8 +43,8 @@
using namespace std;
namespace Trace {
+
const string DefaultName("global");
-FlagVec flags(NumFlags, false);
bool enabled = false;
//
@@ -149,63 +147,4 @@ dump(Tick when, const std::string &name, const void *d, int len)
}
}
-bool
-changeFlag(const char *s, bool value)
-{
- using namespace Trace;
- std::string str(s);
-
- for (int i = 0; i < numFlagStrings; ++i) {
- if (str != flagStrings[i])
- continue;
-
- if (i < NumFlags) {
- flags[i] = value;
- } else {
- i -= NumFlags;
-
- const Flags *flagVec = compoundFlags[i];
- for (int j = 0; flagVec[j] != -1; ++j) {
- if (flagVec[j] < NumFlags)
- flags[flagVec[j]] = value;
- }
- }
-
- return true;
- }
-
- // the flag was not found.
- return false;
-}
-
-void
-dumpStatus()
-{
- using namespace Trace;
- for (int i = 0; i < numFlagStrings; ++i) {
- if (flags[i])
- cprintf("%s\n", flagStrings[i]);
- }
-}
-
} // namespace Trace
-
-
-// add a set of functions that can easily be invoked from gdb
-void
-setTraceFlag(const char *string)
-{
- Trace::changeFlag(string, true);
-}
-
-void
-clearTraceFlag(const char *string)
-{
- Trace::changeFlag(string, false);
-}
-
-void
-dumpTraceStatus()
-{
- Trace::dumpStatus();
-}