* "traced" now always prints the index numbers (before, it only did that
when a pattern was involved). * alloc_tracing_buffer() no longer allocates anything when you ask for a zero byte buffer. * Fixed warning. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23533 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -201,7 +201,7 @@ dump_tracing(int argc, char** argv)
|
|||||||
|
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start = 0;
|
start = 0;
|
||||||
if (start + count > sEntries)
|
if (uint32(start + count) > sEntries)
|
||||||
count = sEntries - start;
|
count = sEntries - start;
|
||||||
|
|
||||||
int32 index = 0;
|
int32 index = 0;
|
||||||
@@ -229,10 +229,7 @@ dump_tracing(int argc, char** argv)
|
|||||||
|
|
||||||
dumped++;
|
dumped++;
|
||||||
|
|
||||||
if (pattern != NULL)
|
kprintf("%5ld. %s\n", index, buffer);
|
||||||
kprintf("%5ld. %s\n", index, buffer);
|
|
||||||
else
|
|
||||||
kprintf("%s\n", buffer);
|
|
||||||
} else
|
} else
|
||||||
kprintf("%5ld. ** uninitialized entry **\n", index);
|
kprintf("%5ld. ** uninitialized entry **\n", index);
|
||||||
}
|
}
|
||||||
@@ -249,6 +246,9 @@ dump_tracing(int argc, char** argv)
|
|||||||
extern "C" uint8*
|
extern "C" uint8*
|
||||||
alloc_tracing_buffer(size_t size)
|
alloc_tracing_buffer(size_t size)
|
||||||
{
|
{
|
||||||
|
if (size == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
#if ENABLE_TRACING
|
#if ENABLE_TRACING
|
||||||
trace_entry* entry = allocate_entry(size + sizeof(trace_entry));
|
trace_entry* entry = allocate_entry(size + sizeof(trace_entry));
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user