From b2d95c3c1dc89dd28b0132d2ac9355c1f3ebbf6b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 27 Apr 2008 14:00:37 +0000 Subject: [PATCH] * Reverted r25209. We need the symbol even with tracing disabled, since modules could use it. Moved the tracing_stack_trace definition out of the conditional section instead. * Made the TraceOutput::Print()/PrintStackTrace() method no-ops when tracing is disabled. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25211 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/tracing.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/system/kernel/debug/tracing.cpp b/src/system/kernel/debug/tracing.cpp index c2f13fbd7a..976441eaac 100644 --- a/src/system/kernel/debug/tracing.cpp +++ b/src/system/kernel/debug/tracing.cpp @@ -20,6 +20,12 @@ #include +struct tracing_stack_trace { + int32 depth; + addr_t return_addresses[0]; +}; + + #if ENABLE_TRACING //#define TRACE_TRACING @@ -37,11 +43,6 @@ enum { FILTER_MATCH = 0x08 }; -struct tracing_stack_trace { - int32 depth; - addr_t return_addresses[0]; -}; - static const size_t kTraceOutputBufferSize = 10240; static const size_t kBufferSize = MAX_TRACE_SIZE / 4; @@ -239,6 +240,7 @@ TraceOutput::Clear() void TraceOutput::Print(const char* format,...) { +#if ENABLE_TRACING if (IsFull()) return; @@ -246,13 +248,14 @@ TraceOutput::Print(const char* format,...) va_start(args, format); fSize += vsnprintf(fBuffer + fSize, fCapacity - fSize, format, args); va_end(args); +#endif } -#if ENABLE_TRACING void TraceOutput::PrintStackTrace(tracing_stack_trace* stackTrace) { +#if ENABLE_TRACING if (stackTrace == NULL || stackTrace->depth <= 0) return; @@ -272,8 +275,8 @@ TraceOutput::PrintStackTrace(tracing_stack_trace* stackTrace) } else Print(" %p\n", (void*)address); } +#endif } -#endif // ENABLE_TRACING void