diff --git a/src/arch/arm/nativetrace.cc b/src/arch/arm/nativetrace.cc index 805c139c2b..d1f6854a20 100644 --- a/src/arch/arm/nativetrace.cc +++ b/src/arch/arm/nativetrace.cc @@ -51,7 +51,6 @@ using namespace ArmISA; namespace Trace { -#if TRACING_ON static const char *regNames[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "fp", "r12", "sp", "lr", "pc", @@ -61,7 +60,6 @@ static const char *regNames[] = { "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", "fpscr" }; -#endif void Trace::ArmNativeTrace::ThreadState::update(NativeTrace *parent) diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index 043cce7e64..51a0b7d45b 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -286,9 +286,7 @@ SparcProcess::argsInit(int pageSize) IntType envp_array_base = auxv_array_base - envp_array_size; IntType argv_array_base = envp_array_base - argv_array_size; IntType argc_base = argv_array_base - argc_size; -#if TRACING_ON IntType window_save_base = argc_base - window_save_size; -#endif DPRINTF(Stack, "The addresses of items on the initial stack:\n"); DPRINTF(Stack, "%#x - sentry NULL\n", sentry_base); diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc index 8839f81f7c..939baa287d 100644 --- a/src/base/remote_gdb.cc +++ b/src/base/remote_gdb.cc @@ -332,7 +332,6 @@ enum GdbBreakpointType GdbAccWp = '4', }; -#ifndef NDEBUG const char * breakType(char c) { @@ -345,7 +344,6 @@ breakType(char c) default: return "unknown breakpoint/watchpoint"; } } -#endif std::map hardBreakMap; diff --git a/src/base/trace.hh b/src/base/trace.hh index 8796d8a5d1..fec9822fe8 100644 --- a/src/base/trace.hh +++ b/src/base/trace.hh @@ -173,72 +173,62 @@ const std::string &name(); * @{ */ -#if TRACING_ON - #define DDUMP(x, data, count) do { \ - if (M5_UNLIKELY(DTRACE(x))) \ + if (M5_UNLIKELY(TRACING_ON && DTRACE(x))) \ Trace::getDebugLogger()->dump( \ curTick(), name(), data, count, #x); \ } while (0) #define DPRINTF(x, ...) do { \ - if (M5_UNLIKELY(DTRACE(x))) { \ + if (M5_UNLIKELY(TRACING_ON && DTRACE(x))) { \ Trace::getDebugLogger()->dprintf_flag( \ curTick(), name(), #x, __VA_ARGS__); \ } \ } while (0) #define DPRINTFS(x, s, ...) do { \ - if (M5_UNLIKELY(DTRACE(x))) { \ + if (M5_UNLIKELY(TRACING_ON && DTRACE(x))) { \ Trace::getDebugLogger()->dprintf_flag( \ curTick(), s->name(), #x, __VA_ARGS__); \ } \ } while (0) #define DPRINTFR(x, ...) do { \ - if (M5_UNLIKELY(DTRACE(x))) { \ + if (M5_UNLIKELY(TRACING_ON && DTRACE(x))) { \ Trace::getDebugLogger()->dprintf_flag( \ (Tick)-1, std::string(), #x, __VA_ARGS__); \ } \ } while (0) #define DPRINTFV(x, ...) do { \ - if (M5_UNLIKELY(x)) { \ + if (M5_UNLIKELY(TRACING_ON && (x))) { \ Trace::getDebugLogger()->dprintf_flag( \ curTick(), name(), x.name(), __VA_ARGS__); \ } \ } while (0) -#define DPRINTFN(...) do { \ - Trace::getDebugLogger()->dprintf(curTick(), name(), __VA_ARGS__); \ +#define DPRINTFN(...) do { \ + if (TRACING_ON) { \ + Trace::getDebugLogger()->dprintf(curTick(), name(), __VA_ARGS__); \ + } \ } while (0) -#define DPRINTFNR(...) do { \ - Trace::getDebugLogger()->dprintf((Tick)-1, std::string(), __VA_ARGS__); \ +#define DPRINTFNR(...) do { \ + if (TRACING_ON) { \ + Trace::getDebugLogger()->dprintf((Tick)-1, "", __VA_ARGS__); \ + } \ } while (0) -#define DPRINTF_UNCONDITIONAL(x, ...) \ - GEM5_DEPRECATED_MACRO_STMT(DPRINTF_UNCONDITIONAL, \ - do { Trace::getDebugLogger()->dprintf_flag( \ - curTick(), name(), #x, __VA_ARGS__); \ - } while (0), \ +#define DPRINTF_UNCONDITIONAL(x, ...) \ + GEM5_DEPRECATED_MACRO_STMT(DPRINTF_UNCONDITIONAL, \ + do { \ + if (TRACING_ON) { \ + Trace::getDebugLogger()->dprintf_flag( \ + curTick(), name(), #x, __VA_ARGS__); \ + } \ + } while (0), \ "Use DPRINTFN or DPRINTF with a debug flag instead.") -#else // !TRACING_ON - -#define DDUMP(x, data, count) do {} while (0) -#define DPRINTF(x, ...) do {} while (0) -#define DPRINTFS(x, ...) do {} while (0) -#define DPRINTFR(...) do {} while (0) -#define DPRINTFV(...) do {} while (0) -#define DPRINTFN(...) do {} while (0) -#define DPRINTFNR(...) do {} while (0) -#define DPRINTF_UNCONDITIONAL(x, ...) \ - GEM5_DEPRECATED_MACRO_STMT(DPRINTF_UNCONDITIONAL, do {} while (0), \ - "Use DPRINTFN or DPRINTF with a debug flag instead.") - -#endif // TRACING_ON - /** @} */ // end of api_trace #endif // __BASE_TRACE_HH__ diff --git a/src/dev/net/i8254xGBe.cc b/src/dev/net/i8254xGBe.cc index 5e78bdc22f..8388b3b94c 100644 --- a/src/dev/net/i8254xGBe.cc +++ b/src/dev/net/i8254xGBe.cc @@ -992,9 +992,7 @@ IGbE::DescCache::fetchComplete() } -#ifndef NDEBUG int oldCp = cachePnt; -#endif cachePnt += curFetching; assert(cachePnt <= descLen()); @@ -1015,10 +1013,8 @@ void IGbE::DescCache::wbComplete() { - long curHead = descHead(); -#ifndef NDEBUG + long curHead = descHead(); long oldHead = curHead; -#endif for (int x = 0; x < wbOut; x++) { assert(usedCache.size()); diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc index e35caceda6..772dc862aa 100644 --- a/src/mem/cache/base.cc +++ b/src/mem/cache/base.cc @@ -1417,9 +1417,7 @@ BaseCache::handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks, Addr addr = pkt->getAddr(); bool is_secure = pkt->isSecure(); const bool has_old_data = blk && blk->isValid(); -#if TRACING_ON const std::string old_state = blk ? blk->print() : ""; -#endif // When handling a fill, we should have no writes to this line. assert(addr == pkt->getBlockAddr(blkSize)); diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc index 4bec7de38e..d5c6b55f37 100644 --- a/src/mem/cache/cache.cc +++ b/src/mem/cache/cache.cc @@ -591,9 +591,7 @@ Cache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, DPRINTF(Cache, "%s: Sending an atomic %s\n", __func__, bus_pkt->print()); -#if TRACING_ON const std::string old_state = blk ? blk->print() : ""; -#endif Cycles latency = ticksToCycles(memSidePort.sendAtomic(bus_pkt));