From f70280a7330b597ed217a87bf74afcfa4d5f3a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 18 Jan 2008 18:18:35 +0000 Subject: [PATCH] * alloc_tracing_buffer() now refuses to allocate more than 65532 bytes; we use a uint16 size internally (and that has to include the length of the trace_entry structure, too. * We now track how many entries have been written to the log during the runtime. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23613 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/tracing.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/debug/tracing.cpp b/src/system/kernel/debug/tracing.cpp index 52287659ed..ec73f39da9 100644 --- a/src/system/kernel/debug/tracing.cpp +++ b/src/system/kernel/debug/tracing.cpp @@ -35,6 +35,7 @@ static trace_entry* sBuffer; static trace_entry* sBufferStart; static trace_entry* sBufferEnd; static uint32 sEntries; +static uint32 sWritten; static spinlock sLock; @@ -166,6 +167,7 @@ TraceEntry::Initialized() { #if ENABLE_TRACING flags |= ENTRY_INITIALIZED; + sWritten++; #endif } @@ -259,8 +261,8 @@ dump_tracing(int argc, char** argv) dumped++; } - kprintf("entries %ld to %ld (%ld of %ld).\n", start, start + count - 1, - dumped, sEntries); + kprintf("entries %ld to %ld (%ld of %ld). %ld entries written\n", start, + start + count - 1, dumped, sEntries, sWritten); set_debug_variable("_tracingStart", start); set_debug_variable("_tracingCount", count); @@ -275,7 +277,7 @@ dump_tracing(int argc, char** argv) extern "C" uint8* alloc_tracing_buffer(size_t size) { - if (size == 0) + if (size == 0 || size >= 65532) return NULL; #if ENABLE_TRACING