virtual void AddDump(TraceOutput& out) { if (fResult >= 0) { out.Print("poll done: count: %d: ", fResult); PollTraceEntry::AddDump(out); } else out.Print("poll done: error: %#x", fResult); }
virtual void AddDump(TraceOutput& out) { out.Print("syscall pre: %s(", get_syscall_name(fSyscall)); if (fParameters != NULL) { int32 stringIndex = 0; const extended_syscall_info& syscallInfo = kExtendedSyscallInfos[fSyscall]; for (int i = 0; i < syscallInfo.parameter_count; i++) { const syscall_parameter_info& paramInfo = syscallInfo.parameters[i]; const uint8* data = (uint8*)fParameters + paramInfo.offset; uint64 value = 0; bool printValue = true; switch (paramInfo.type) { case B_INT8_TYPE: value = *(uint8*)data; break; case B_INT16_TYPE: value = *(uint16*)data; break; case B_INT32_TYPE: value = *(uint32*)data; break; case B_INT64_TYPE: value = *(uint64*)data; break; case B_POINTER_TYPE: value = (uint64)*(void**)data; break; case B_STRING_TYPE: if (stringIndex < MAX_PARAM_STRINGS && fSyscall != SYSCALL_KTRACE_OUTPUT) { out.Print("%s\"%s\"", (i == 0 ? "" : ", "), fParameterStrings[stringIndex++]); printValue = false; } else value = (uint64)*(void**)data; break; } if (printValue) out.Print("%s%#" B_PRIx64, (i == 0 ? "" : ", "), value); } } out.Print(")"); }
void AbstractTraceEntry::Dump(TraceOutput& out) { bigtime_t time = (out.Flags() & TRACE_OUTPUT_DIFF_TIME) ? fTime - out.LastEntryTime() : fTime; if (out.Flags() & TRACE_OUTPUT_TEAM_ID) out.Print("[%6ld:%6ld] %10Ld: ", fThread, fTeam, time); else out.Print("[%6ld] %10Ld: ", fThread, time); AddDump(out); out.SetLastEntryTime(fTime); }
virtual void AddDump(TraceOutput& out) { out.Print("object cache create: name: \"%s\", object size: %lu, " "alignment: %lu, max usage: %lu, flags: 0x%lx, cookie: %p " "-> cache: %p", fName, fObjectSize, fAlignment, fMaxByteUsage, fFlags, fCookie, fCache); }
virtual void AddDump(TraceOutput& out) { if (fStatus == B_OK) SelectTraceEntry::AddDump(out, "select done: "); else out.Print("select done: error: %#" B_PRIx32, fStatus); }
void TraceEntry::Dump(TraceOutput& out) { #if ENABLE_TRACING // to be overridden by subclasses out.Print("ENTRY %p", this); #endif }
void AddDump(TraceOutput& out, const char* name) { out.Print(name); _PrintSet(out, "read", fReadSet); _PrintSet(out, ", write", fWriteSet); _PrintSet(out, ", error", fErrorSet); }
virtual void AddDump(TraceOutput& out) { out.Print("signal action: thread: %ld, signal: %lu (%s), " "action: {handler: %p, flags: 0x%x, mask: 0x%lx}", fThread, fSignal, (fSignal < NSIG ? sigstr[fSignal] : "invalid"), fAction.sa_handler, fAction.sa_flags, fAction.sa_mask); }
virtual void AddDump(TraceOutput& out) { out.Print("guarded heap allocate: heap: %p; page: %p; " "flags:%s%s%s%s", fHeap, fPageBase, (fFlags & GUARDED_HEAP_PAGE_FLAG_USED) != 0 ? " used" : "", (fFlags & GUARDED_HEAP_PAGE_FLAG_FIRST) != 0 ? " first" : "", (fFlags & GUARDED_HEAP_PAGE_FLAG_GUARD) != 0 ? " guard" : "", (fFlags & GUARDED_HEAP_PAGE_FLAG_DEAD) != 0 ? " dead" : ""); }
void AddDump(TraceOutput& out) { if (fEntries == NULL) return; static const struct { const char* name; uint16 event; } kEventNames[] = { { "r", POLLIN }, { "w", POLLOUT }, { "rb", POLLRDBAND }, { "wb", POLLWRBAND }, { "rp", POLLPRI }, { "err", POLLERR }, { "hup", POLLHUP }, { "inv", POLLNVAL }, { NULL, 0 } }; bool firstFD = true; for (int i = 0; i < fCount; i++) { if (firstFD) { out.Print("<%u: ", fEntries[i].fd); firstFD = false; } else out.Print(", <%u: ", fEntries[i].fd); bool firstEvent = true; for (int k = 0; kEventNames[k].name != NULL; k++) { if ((fEntries[i].events & kEventNames[k].event) != 0) { if (firstEvent) { out.Print("%s", kEventNames[k].name); firstEvent = false; } else out.Print(", %s", kEventNames[k].name); } } out.Print(">"); } }
void _PrintSet(TraceOutput& out, const char* name, fd_set* set) { out.Print("%s: <", name); if (set != NULL) { bool first = true; for (int i = 0; i < fCount; i++) { if (!FD_ISSET(i, set)) continue; if (first) { out.Print("%d", i); first = false; } else out.Print(", %d", i); } } out.Print(">"); }
virtual void AddDump(TraceOutput& out) { const char* how = "invalid"; switch (fHow) { case SIG_BLOCK: how = "block"; break; case SIG_UNBLOCK: how = "unblock"; break; case SIG_SETMASK: how = "set"; break; } out.Print("signal proc mask: %s 0x%lx, old mask: 0x%lx", how, fMask, fOldMask); }
virtual void AddDump(TraceOutput& out) { out.Print("object cache delete: %p", fCache); }
virtual void AddDump(TraceOutput& out) { out.Print("guarded heap free: heap: %p; page: %p", fHeap, fPageBase); }
virtual void AddDump(TraceOutput& out) { out.Print("syscall post: %s() -> %#" B_PRIx64, get_syscall_name(fSyscall), fReturnValue); }
virtual void AddDump(TraceOutput& out) { out.Print("port %ld created, name \"%s\", owner %ld, capacity %ld", fID, fName, fOwner, fCapacity); }
virtual void AddDump(TraceOutput& out) { out.Print("ktrace start"); }
virtual void AddDump(TraceOutput& out) { out.Print("object cache reserve: cache: %p, count: %lu, " "flags: 0x%lx", fCache, fCount, fFlags); }
virtual void AddDump(TraceOutput& out) { out.Print("object cache alloc: cache: %p, flags: 0x%lx -> " "object: %p", fCache, fFlags, fObject); }
virtual void AddDump(TraceOutput& out) { out.Print("signal handle: 0x%lx", fSignals); }
virtual void AddDump(TraceOutput& out) { out.Print("poll begin: "); PollTraceEntry::AddDump(out); out.Print(", timeout: %" B_PRIdBIGTIME, fTimeout); }
virtual void AddDump(TraceOutput& out) { SelectTraceEntry::AddDump(out, "select begin: "); out.Print(", timeout: %" B_PRIdBIGTIME, fTimeout); }
virtual void AddDump(TraceOutput& out) { out.Print("object cache free: cache: %p, object: %p", fCache, fObject); }
virtual void AddDump(TraceOutput& out) { out.Print("port %ld deleted", fID); }
virtual void AddDump(TraceOutput& out) { out.Print("port %ld write, read %ld, write %ld, code %lx, size %ld: %ld", fID, fReadCount, fWriteCount, fCode, fBufferSize, fResult); }
virtual void AddDump(TraceOutput& out) { out.Print("port %ld info, read %ld, write %ld, code %lx: %ld", fID, fReadCount, fWriteCount, fCode, fResult); }
virtual void AddDump(TraceOutput& out) { out.Print("user: %s", fMessage); }
virtual void AddDump(TraceOutput& out) { out.Print("port %ld owner change from %ld to %ld: %s", fID, fOldOwner, fNewOwner, strerror(fStatus)); }
virtual void AddDump(TraceOutput& out) { out.Print("syscall restart"); }
virtual void AddDump(TraceOutput& out) { out.Print("signal send: target: %ld, signal: %lu (%s), " "flags: 0x%lx", fTarget, fSignal, (fSignal < NSIG ? sigstr[fSignal] : "invalid"), fFlags); }