* 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
This commit is contained in:
parent
1cae077af9
commit
b2d95c3c1d
@ -20,6 +20,12 @@
|
|||||||
#include <util/AutoLock.h>
|
#include <util/AutoLock.h>
|
||||||
|
|
||||||
|
|
||||||
|
struct tracing_stack_trace {
|
||||||
|
int32 depth;
|
||||||
|
addr_t return_addresses[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#if ENABLE_TRACING
|
#if ENABLE_TRACING
|
||||||
|
|
||||||
//#define TRACE_TRACING
|
//#define TRACE_TRACING
|
||||||
@ -37,11 +43,6 @@ enum {
|
|||||||
FILTER_MATCH = 0x08
|
FILTER_MATCH = 0x08
|
||||||
};
|
};
|
||||||
|
|
||||||
struct tracing_stack_trace {
|
|
||||||
int32 depth;
|
|
||||||
addr_t return_addresses[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static const size_t kTraceOutputBufferSize = 10240;
|
static const size_t kTraceOutputBufferSize = 10240;
|
||||||
static const size_t kBufferSize = MAX_TRACE_SIZE / 4;
|
static const size_t kBufferSize = MAX_TRACE_SIZE / 4;
|
||||||
@ -239,6 +240,7 @@ TraceOutput::Clear()
|
|||||||
void
|
void
|
||||||
TraceOutput::Print(const char* format,...)
|
TraceOutput::Print(const char* format,...)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_TRACING
|
||||||
if (IsFull())
|
if (IsFull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -246,13 +248,14 @@ TraceOutput::Print(const char* format,...)
|
|||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
fSize += vsnprintf(fBuffer + fSize, fCapacity - fSize, format, args);
|
fSize += vsnprintf(fBuffer + fSize, fCapacity - fSize, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_TRACING
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TraceOutput::PrintStackTrace(tracing_stack_trace* stackTrace)
|
TraceOutput::PrintStackTrace(tracing_stack_trace* stackTrace)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_TRACING
|
||||||
if (stackTrace == NULL || stackTrace->depth <= 0)
|
if (stackTrace == NULL || stackTrace->depth <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -272,8 +275,8 @@ TraceOutput::PrintStackTrace(tracing_stack_trace* stackTrace)
|
|||||||
} else
|
} else
|
||||||
Print(" %p\n", (void*)address);
|
Print(" %p\n", (void*)address);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif // ENABLE_TRACING
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user