Deleted Added
sdiff udiff text old ( 4041:f42c73e7e639 ) new ( 4042:dbd98b2264ed )
full compact
1/*
2 * Copyright (c) 2001-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 33 unchanged lines hidden (view full) ---

42#include "base/traceflags.hh"
43
44namespace Trace {
45
46 typedef std::vector<bool> FlagVec;
47
48 extern FlagVec flags;
49
50#if TRACING_ON
51 const bool On = true;
52#else
53 const bool On = false;
54#endif
55
56 inline bool
57 IsOn(int t)
58 {
59 return flags[t];
60
61 }
62
63 void dump(const uint8_t *data, int count);
64
65 class Record
66 {
67 protected:
68 Tick cycle;
69
70 Record(Tick _cycle)

--- 80 unchanged lines hidden (view full) ---

151 {
152 theLog.append(new Trace::DataRecord(when, name, data, len));
153 }
154
155 extern const std::string DefaultName;
156
157};
158
159std::ostream &DebugOut();
160
161// This silly little class allows us to wrap a string in a functor
162// object so that we can give a name() that DPRINTF will like
163struct StringWrap
164{
165 std::string str;
166 StringWrap(const std::string &s) : str(s) {}
167 const std::string &operator()() const { return str; }

--- 8 unchanged lines hidden (view full) ---

176// std::string & in the current scope.
177//
178// If you desire that the automatic printing not occur, use DPRINTFR
179// (R for raw)
180//
181
182#if TRACING_ON
183
184#define DTRACE(x) (Trace::IsOn(Trace::x))
185
186#define DDUMP(x, data, count) do { \
187 if (DTRACE(x)) \
188 Trace::dataDump(curTick, name(), data, count); \
189} while (0)
190
191#define DPRINTF(x, ...) do { \
192 if (DTRACE(x)) \

--- 28 unchanged lines hidden ---