From 1aed2639980676c51f2a3e102ea3cc2e745adb65 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 3 Mar 2010 23:23:09 +0000 Subject: [PATCH] TracingMetaData::_InitPreviousTracingData(): * More output. * Actually increment errorCount when encountering an error. The loop condition would never be false this way. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35750 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/tracing.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/system/kernel/debug/tracing.cpp b/src/system/kernel/debug/tracing.cpp index 3601f268ac..1beed7147e 100644 --- a/src/system/kernel/debug/tracing.cpp +++ b/src/system/kernel/debug/tracing.cpp @@ -474,6 +474,9 @@ TracingMetaData::_InitPreviousTracingData() return false; } + dprintf("ktrace: Remapped tracing buffer at %p, size: %" B_PRIuSIZE "\n", + buffer, kTraceOutputBufferSize + MAX_TRACE_SIZE); + // verify/repair the tracing entry list uint32 errorCount = 0; uint32 entryCount = 0; @@ -487,6 +490,7 @@ TracingMetaData::_InitPreviousTracingData() dprintf("ktrace recovering: entry %p: fixing previous_size " "size: %lu (should be %lu)\n", entry, entry->previous_size, previousEntrySize); + errorCount++; } entry->previous_size = previousEntrySize; } @@ -498,6 +502,7 @@ TracingMetaData::_InitPreviousTracingData() if ((entry->flags & WRAP_ENTRY) == 0 && entry->size == 0) { dprintf("ktrace recovering: entry %p: non-wrap entry size is 0\n", entry); + errorCount++; fAfterLastEntry = entry; break; } @@ -505,6 +510,7 @@ TracingMetaData::_InitPreviousTracingData() if (entry->size > uint32(fBuffer + kBufferSize - entry)) { dprintf("ktrace recovering: entry %p: size too big: %lu\n", entry, entry->size); + errorCount++; fAfterLastEntry = entry; break; } @@ -512,6 +518,7 @@ TracingMetaData::_InitPreviousTracingData() if (entry < fAfterLastEntry && entry + entry->size > fAfterLastEntry) { dprintf("ktrace recovering: entry %p: entry crosses " "fAfterLastEntry (%p)\n", entry, fAfterLastEntry); + errorCount++; fAfterLastEntry = entry; break; } @@ -522,11 +529,13 @@ TracingMetaData::_InitPreviousTracingData() > kMaxTracingEntryByteSize / sizeof(trace_entry)) { dprintf("ktrace recovering: entry %p: wrap entry at invalid " "buffer location\n", entry); + errorCount++; } if (entry->size != 0) { dprintf("ktrace recovering: entry %p: invalid wrap entry " "size: %lu\n", entry, entry->size); + errorCount++; entry->size = 0; }