Fixed compilation errors with ENABLE_TRACING set.

This commit is contained in:
Alex Smith 2013-03-22 16:46:09 +00:00
parent 1aef6664d1
commit 8627383bf7
2 changed files with 38 additions and 31 deletions

View File

@ -589,8 +589,8 @@ TracingMetaData::_InitPreviousTracingData()
if (entry->previous_size != previousEntrySize) {
if (entry != fFirstEntry) {
dprintf("ktrace recovering: entry %p: fixing previous_size "
"size: %lu (should be %lu)\n", entry, entry->previous_size,
previousEntrySize);
"size: %" B_PRIu32 " (should be %" B_PRIu32 ")\n", entry,
entry->previous_size, previousEntrySize);
errorCount++;
}
entry->previous_size = previousEntrySize;
@ -609,8 +609,8 @@ TracingMetaData::_InitPreviousTracingData()
}
if (entry->size > uint32(fBuffer + kBufferSize - entry)) {
dprintf("ktrace recovering: entry %p: size too big: %lu\n", entry,
entry->size);
dprintf("ktrace recovering: entry %p: size too big: %" B_PRIu32 "\n",
entry, entry->size);
errorCount++;
fAfterLastEntry = entry;
break;
@ -635,7 +635,7 @@ TracingMetaData::_InitPreviousTracingData()
if (entry->size != 0) {
dprintf("ktrace recovering: entry %p: invalid wrap entry "
"size: %lu\n", entry, entry->size);
"size: %" B_PRIu32 "\n", entry, entry->size);
errorCount++;
entry->size = 0;
}
@ -662,9 +662,10 @@ TracingMetaData::_InitPreviousTracingData()
fAfterLastEntry->previous_size = previousEntrySize;
}
dprintf("ktrace recovering: Recovered %lu entries + %lu buffer entries "
"from previous session. Expected %lu entries.\n", nonBufferEntryCount,
entryCount - nonBufferEntryCount, fEntries);
dprintf("ktrace recovering: Recovered %" B_PRIu32 " entries + %" B_PRIu32
" buffer entries from previous session. Expected %" B_PRIu32
" entries.\n", nonBufferEntryCount, entryCount - nonBufferEntryCount,
fEntries);
fEntries = nonBufferEntryCount;
B_INITIALIZE_SPINLOCK(&fLock);
@ -1547,7 +1548,7 @@ dump_tracing_internal(int argc, char** argv, WrapperTraceFilter* wrapperFilter)
if (len > 0 && dump[len - 1] == '\n')
len--;
kprintf("%5ld. %.*s\n", index, len, dump);
kprintf("%5" B_PRId32 ". %.*s\n", index, len, dump);
if (printStackTrace) {
out.Clear();
@ -1556,15 +1557,15 @@ dump_tracing_internal(int argc, char** argv, WrapperTraceFilter* wrapperFilter)
kputs(out.Buffer());
}
} else if (!filter)
kprintf("%5ld. ** uninitialized entry **\n", index);
kprintf("%5" B_PRId32 ". ** uninitialized entry **\n", index);
dumped++;
}
kprintf("printed %ld entries within range %ld to %ld (%ld of %ld total, "
"%ld ever)\n", dumped, firstToCheck, lastToCheck,
lastToCheck - firstToCheck + 1, sTracingMetaData->Entries(),
entriesEver);
kprintf("printed %" B_PRId32 " entries within range %" B_PRId32 " to %"
B_PRId32 " (%" B_PRId32 " of %" B_PRId32 " total, %" B_PRId32 " ever)\n",
dumped, firstToCheck, lastToCheck, lastToCheck - firstToCheck + 1,
sTracingMetaData->Entries(), entriesEver);
// store iteration state
_previousCount = count;

View File

@ -545,8 +545,9 @@ namespace VFSPagesIOTracing {
class PagesIOTraceEntry : public AbstractTraceEntry {
protected:
PagesIOTraceEntry(struct vnode* vnode, void* cookie, off_t pos,
const generic_io_vec* vecs, uint32 count, uint32 flags, generic_size_t bytesRequested,
status_t status, generic_size_t bytesTransferred)
const generic_io_vec* vecs, uint32 count, uint32 flags,
generic_size_t bytesRequested, status_t status,
generic_size_t bytesTransferred)
:
fVnode(vnode),
fMountID(vnode->mount->id),
@ -559,26 +560,29 @@ protected:
fStatus(status),
fBytesTransferred(bytesTransferred)
{
fVecs = (generic_io_vec*)alloc_tracing_buffer_memcpy(vecs, sizeof(generic_io_vec) * count,
false);
fVecs = (generic_io_vec*)alloc_tracing_buffer_memcpy(vecs,
sizeof(generic_io_vec) * count, false);
}
void AddDump(TraceOutput& out, const char* mode)
{
out.Print("vfs pages io %5s: vnode: %p (%ld, %lld), cookie: %p, "
"pos: %lld, size: %llu, vecs: {", mode, fVnode, fMountID, fNodeID,
fCookie, fPos, (uint64)fBytesRequested);
out.Print("vfs pages io %5s: vnode: %p (%" B_PRId32 ", %" B_PRId64 "), "
"cookie: %p, pos: %" B_PRIdOFF ", size: %" B_PRIu64 ", vecs: {",
mode, fVnode, fMountID, fNodeID, fCookie, fPos,
(uint64)fBytesRequested);
if (fVecs != NULL) {
for (uint32 i = 0; i < fCount; i++) {
if (i > 0)
out.Print(", ");
out.Print("(%llx, %llu)", (uint64)fVecs[i].base, (uint64)fVecs[i].length);
out.Print("(%" B_PRIx64 ", %" B_PRIu64 ")", (uint64)fVecs[i].base,
(uint64)fVecs[i].length);
}
}
out.Print("}, flags: %#lx -> status: %#lx, transferred: %llu",
fFlags, fStatus, (uint64)fBytesTransferred);
out.Print("}, flags: %#" B_PRIx32 " -> status: %#" B_PRIx32 ", "
"transferred: %" B_PRIu64, fFlags, fStatus,
(uint64)fBytesTransferred);
}
protected:
@ -587,20 +591,21 @@ protected:
ino_t fNodeID;
void* fCookie;
off_t fPos;
generic_io_vec* fVecs;
generic_io_vec* fVecs;
uint32 fCount;
uint32 fFlags;
generic_size_t fBytesRequested;
generic_size_t fBytesRequested;
status_t fStatus;
generic_size_t fBytesTransferred;
generic_size_t fBytesTransferred;
};
class ReadPages : public PagesIOTraceEntry {
public:
ReadPages(struct vnode* vnode, void* cookie, off_t pos,
const generic_io_vec* vecs, uint32 count, uint32 flags, generic_size_t bytesRequested,
status_t status, generic_size_t bytesTransferred)
const generic_io_vec* vecs, uint32 count, uint32 flags,
generic_size_t bytesRequested, status_t status,
generic_size_t bytesTransferred)
:
PagesIOTraceEntry(vnode, cookie, pos, vecs, count, flags,
bytesRequested, status, bytesTransferred)
@ -618,8 +623,9 @@ public:
class WritePages : public PagesIOTraceEntry {
public:
WritePages(struct vnode* vnode, void* cookie, off_t pos,
const generic_io_vec* vecs, uint32 count, uint32 flags, generic_size_t bytesRequested,
status_t status, generic_size_t bytesTransferred)
const generic_io_vec* vecs, uint32 count, uint32 flags,
generic_size_t bytesRequested, status_t status,
generic_size_t bytesTransferred)
:
PagesIOTraceEntry(vnode, cookie, pos, vecs, count, flags,
bytesRequested, status, bytesTransferred)