~AccumulatedTraceData()
{
- fprintf(stdout, "# strings: %lu\n# ips: %lu\n",
+ fprintf(stdout, "# strings: %zu\n# ips: %zu\n",
m_internedData.size(), m_encounteredIps.size());
}
m_encounteredIps.insert(it, make_pair(instructionPointer, ipId));
const auto ip = resolve(instructionPointer);
- fprintf(stdout, "i %lx %lx", instructionPointer, ip.moduleIndex);
+ fprintf(stdout, "i %zx %zx", instructionPointer, ip.moduleIndex);
if (ip.functionIndex || ip.fileIndex) {
- fprintf(stdout, " %lx", ip.functionIndex);
+ fprintf(stdout, " %zx", ip.functionIndex);
if (ip.fileIndex) {
- fprintf(stdout, " %lx %x", ip.fileIndex, ip.line);
+ fprintf(stdout, " %zx %x", ip.fileIndex, ip.line);
}
}
fputc('\n', stdout);
// ensure ip is encountered
const auto ipId = data.addIp(instructionPointer);
// trace point, map current output index to parent index
- fprintf(stdout, "t %lx %lx\n", ipId, parentIndex);
+ fprintf(stdout, "t %zx %zx\n", ipId, parentIndex);
} else {
fputs(reader.line().c_str(), stdout);
fputc('\n', stdout);
auto elapsed = chrono::duration_cast<chrono::milliseconds>(clock::now() - s_data->start);
- debugLog<VeryVerboseOutput>("writeTimestamp(%lx)", elapsed.count());
+ debugLog<VeryVerboseOutput>("writeTimestamp(%" PRIx64 ")", elapsed.count());
- if (fprintf(s_data->out, "c %lx\n", elapsed.count()) < 0) {
+ if (fprintf(s_data->out, "c %" PRIx64 "\n", elapsed.count()) < 0) {
writeError();
return;
}
s_data->known.insert(ptr);
#endif
- if (fprintf(s_data->out, "+ %lx %lx %lx\n", size, index, reinterpret_cast<uintptr_t>(ptr)) < 0) {
+ if (fprintf(s_data->out, "+ %zx %zx %" PRIxPTR "\n", size, index, reinterpret_cast<uintptr_t>(ptr)) < 0) {
writeError();
return;
}
s_data->known.erase(it);
#endif
- if (fprintf(s_data->out, "- %lx\n", reinterpret_cast<uintptr_t>(ptr)) < 0) {
+ if (fprintf(s_data->out, "- %" PRIxPTR "\n", reinterpret_cast<uintptr_t>(ptr)) < 0) {
writeError();
return;
}
fileName = "x";
}
- debugLog<VerboseOutput>("dlopen_notify_callback: %s %lx", fileName, info->dlpi_addr);
+ debugLog<VerboseOutput>("dlopen_notify_callback: %s %zx", fileName, info->dlpi_addr);
- if (fprintf(heaptrack->s_data->out, "m %s %lx", fileName, info->dlpi_addr) < 0) {
+ if (fprintf(heaptrack->s_data->out, "m %s %zx", fileName, info->dlpi_addr) < 0) {
heaptrack->writeError();
return 1;
}
for (int i = 0; i < info->dlpi_phnum; i++) {
const auto& phdr = info->dlpi_phdr[i];
if (phdr.p_type == PT_LOAD) {
- if (fprintf(heaptrack->s_data->out, " %lx %lx", phdr.p_vaddr, phdr.p_memsz) < 0) {
+ if (fprintf(heaptrack->s_data->out, " %zx %zx", phdr.p_vaddr, phdr.p_memsz) < 0) {
heaptrack->writeError();
return 1;
}
if (ptr && !RecursionGuard::isActive) {
RecursionGuard guard;
- debugLog<VeryVerboseOutput>("heaptrack_malloc(%p, %lu)", ptr, size);
+ debugLog<VeryVerboseOutput>("heaptrack_malloc(%p, %zu)", ptr, size);
Trace trace;
trace.fill(2 + HEAPTRACK_DEBUG_BUILD);
if (ptr_out && !RecursionGuard::isActive) {
RecursionGuard guard;
- debugLog<VeryVerboseOutput>("heaptrack_realloc(%p, %lu, %p)", ptr_in, size, ptr_out);
+ debugLog<VeryVerboseOutput>("heaptrack_realloc(%p, %zu, %p)", ptr_in, size, ptr_out);
Trace trace;
trace.fill(2 + HEAPTRACK_DEBUG_BUILD);