diff options
author | Nathan Binkert <binkertn@umich.edu> | 2007-02-09 14:39:56 -0800 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2007-02-09 14:39:56 -0800 |
commit | a24ccc1ef21a5b6bb74f2ef1358a99cffc72c434 (patch) | |
tree | 8c941c0f287ba5ad633033cf900b937bbed541cf /src/base/trace.hh | |
parent | 27c2138882ac54b1ba51583d9fd52ca2303e8fc8 (diff) | |
download | gem5-a24ccc1ef21a5b6bb74f2ef1358a99cffc72c434.tar.xz |
Get rid of the Trace ParamContext and give python direct
access to enabling/disabling tracing. Command line is
unchanged except for the removal of --trace-cycle since
it's not so clear what that means.
--HG--
extra : convert_revision : c0164d92d3615d76d0c6acaabaafd92a9278212a
Diffstat (limited to 'src/base/trace.hh')
-rw-r--r-- | src/base/trace.hh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/base/trace.hh b/src/base/trace.hh index 739f7fe03..dbe98a11b 100644 --- a/src/base/trace.hh +++ b/src/base/trace.hh @@ -47,19 +47,16 @@ namespace Trace { extern FlagVec flags; -#if TRACING_ON - const bool On = true; -#else - const bool On = false; -#endif + extern std::ostream *dprintf_stream; inline bool IsOn(int t) { return flags[t]; - } + extern bool enabled; + void dump(const uint8_t *data, int count); class Record @@ -156,7 +153,11 @@ namespace Trace { }; -std::ostream &DebugOut(); +inline std::ostream & +DebugOut() +{ + return *Trace::dprintf_stream; +} // This silly little class allows us to wrap a string in a functor // object so that we can give a name() that DPRINTF will like @@ -181,7 +182,7 @@ inline const std::string &name() { return Trace::DefaultName; } #if TRACING_ON -#define DTRACE(x) (Trace::IsOn(Trace::x)) +#define DTRACE(x) (Trace::IsOn(Trace::x) && Trace::enabled) #define DDUMP(x, data, count) do { \ if (DTRACE(x)) \ |