diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp @@ -2514,12 +2514,12 @@ static USED void syscall_acquire(uptr pc, uptr addr) { TSAN_SYSCALL(); Acquire(thr, pc, addr); - DPrintf("syscall_acquire(%p)\n", addr); + DPrintf("syscall_acquire(0x%zx))\n", addr); } static USED void syscall_release(uptr pc, uptr addr) { TSAN_SYSCALL(); - DPrintf("syscall_release(%p)\n", addr); + DPrintf("syscall_release(0x%zx)\n", addr); Release(thr, pc, addr); } @@ -2531,12 +2531,12 @@ static USED void syscall_fd_acquire(uptr pc, int fd) { TSAN_SYSCALL(); FdAcquire(thr, pc, fd); - DPrintf("syscall_fd_acquire(%p)\n", fd); + DPrintf("syscall_fd_acquire(%d)\n", fd); } static USED void syscall_fd_release(uptr pc, int fd) { TSAN_SYSCALL(); - DPrintf("syscall_fd_release(%p)\n", fd); + DPrintf("syscall_fd_release(%d)\n", fd); FdRelease(thr, pc, fd); } diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cpp b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cpp @@ -63,7 +63,7 @@ void __tsan_java_init(jptr heap_begin, jptr heap_size) { JAVA_FUNC_ENTER(__tsan_java_init); Initialize(thr); - DPrintf("#%d: java_init(%p, %p)\n", thr->tid, heap_begin, heap_size); + DPrintf("#%d: java_init(0x%zx, 0x%zx)\n", thr->tid, heap_begin, heap_size); DCHECK_EQ(jctx, 0); DCHECK_GT(heap_begin, 0); DCHECK_GT(heap_size, 0); @@ -85,7 +85,7 @@ void __tsan_java_alloc(jptr ptr, jptr size) { JAVA_FUNC_ENTER(__tsan_java_alloc); - DPrintf("#%d: java_alloc(%p, %p)\n", thr->tid, ptr, size); + DPrintf("#%d: java_alloc(0x%zx, 0x%zx)\n", thr->tid, ptr, size); DCHECK_NE(jctx, 0); DCHECK_NE(size, 0); DCHECK_EQ(ptr % kHeapAlignment, 0); @@ -98,7 +98,7 @@ void __tsan_java_free(jptr ptr, jptr size) { JAVA_FUNC_ENTER(__tsan_java_free); - DPrintf("#%d: java_free(%p, %p)\n", thr->tid, ptr, size); + DPrintf("#%d: java_free(0x%zx, 0x%zx)\n", thr->tid, ptr, size); DCHECK_NE(jctx, 0); DCHECK_NE(size, 0); DCHECK_EQ(ptr % kHeapAlignment, 0); @@ -111,7 +111,7 @@ void __tsan_java_move(jptr src, jptr dst, jptr size) { JAVA_FUNC_ENTER(__tsan_java_move); - DPrintf("#%d: java_move(%p, %p, %p)\n", thr->tid, src, dst, size); + DPrintf("#%d: java_move(0x%zx, 0x%zx, 0x%zx)\n", thr->tid, src, dst, size); DCHECK_NE(jctx, 0); DCHECK_NE(size, 0); DCHECK_EQ(src % kHeapAlignment, 0); @@ -147,7 +147,7 @@ jptr __tsan_java_find(jptr *from_ptr, jptr to) { JAVA_FUNC_ENTER(__tsan_java_find); - DPrintf("#%d: java_find(&%p, %p)\n", *from_ptr, to); + DPrintf("#%d: java_find(&0x%zx, 0x%zx)\n", thr->tid, *from_ptr, to); DCHECK_EQ((*from_ptr) % kHeapAlignment, 0); DCHECK_EQ(to % kHeapAlignment, 0); DCHECK_GE(*from_ptr, jctx->heap_begin); @@ -170,7 +170,7 @@ void __tsan_java_mutex_lock(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_mutex_lock); - DPrintf("#%d: java_mutex_lock(%p)\n", thr->tid, addr); + DPrintf("#%d: java_mutex_lock(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -182,7 +182,7 @@ void __tsan_java_mutex_unlock(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_mutex_unlock); - DPrintf("#%d: java_mutex_unlock(%p)\n", thr->tid, addr); + DPrintf("#%d: java_mutex_unlock(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -192,7 +192,7 @@ void __tsan_java_mutex_read_lock(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_mutex_read_lock); - DPrintf("#%d: java_mutex_read_lock(%p)\n", thr->tid, addr); + DPrintf("#%d: java_mutex_read_lock(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -204,7 +204,7 @@ void __tsan_java_mutex_read_unlock(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_mutex_read_unlock); - DPrintf("#%d: java_mutex_read_unlock(%p)\n", thr->tid, addr); + DPrintf("#%d: java_mutex_read_unlock(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -214,7 +214,7 @@ void __tsan_java_mutex_lock_rec(jptr addr, int rec) { JAVA_FUNC_ENTER(__tsan_java_mutex_lock_rec); - DPrintf("#%d: java_mutex_lock_rec(%p, %d)\n", thr->tid, addr, rec); + DPrintf("#%d: java_mutex_lock_rec(0x%zx, %d)\n", thr->tid, addr, rec); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -228,7 +228,7 @@ int __tsan_java_mutex_unlock_rec(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_mutex_unlock_rec); - DPrintf("#%d: java_mutex_unlock_rec(%p)\n", thr->tid, addr); + DPrintf("#%d: java_mutex_unlock_rec(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -238,7 +238,7 @@ void __tsan_java_acquire(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_acquire); - DPrintf("#%d: java_acquire(%p)\n", thr->tid, addr); + DPrintf("#%d: java_acquire(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -248,7 +248,7 @@ void __tsan_java_release(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_release); - DPrintf("#%d: java_release(%p)\n", thr->tid, addr); + DPrintf("#%d: java_release(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); @@ -258,7 +258,7 @@ void __tsan_java_release_store(jptr addr) { JAVA_FUNC_ENTER(__tsan_java_release); - DPrintf("#%d: java_release_store(%p)\n", thr->tid, addr); + DPrintf("#%d: java_release_store(0x%zx)\n", thr->tid, addr); DCHECK_NE(jctx, 0); DCHECK_GE(addr, jctx->heap_begin); DCHECK_LT(addr, jctx->heap_begin + jctx->heap_size); diff --git a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp @@ -218,7 +218,7 @@ } void OnUserAlloc(ThreadState *thr, uptr pc, uptr p, uptr sz, bool write) { - DPrintf("#%d: alloc(%zu) = %p\n", thr->tid, sz, p); + DPrintf("#%d: alloc(%zu) = 0x%zx\n", thr->tid, sz, p); ctx->metamap.AllocBlock(thr, pc, p, sz); if (write && thr->ignore_reads_and_writes == 0) MemoryRangeImitateWrite(thr, pc, (uptr)p, sz); @@ -229,7 +229,7 @@ void OnUserFree(ThreadState *thr, uptr pc, uptr p, bool write) { CHECK_NE(p, (void*)0); uptr sz = ctx->metamap.FreeBlock(thr->proc(), p); - DPrintf("#%d: free(%p, %zu)\n", thr->tid, p, sz); + DPrintf("#%d: free(0x%zx, %zu)\n", thr->tid, p, sz); if (write && thr->ignore_reads_and_writes == 0) MemoryRangeFreed(thr, pc, (uptr)p, sz); } diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp @@ -303,7 +303,7 @@ } void MapThreadTrace(uptr addr, uptr size, const char *name) { - DPrintf("#0: Mapping trace at %p-%p(0x%zx)\n", addr, addr + size, size); + DPrintf("#0: Mapping trace at 0x%zx-0x%zx(0x%zx)\n", addr, addr + size, size); CHECK_GE(addr, TraceMemBeg()); CHECK_LE(addr + size, TraceMemEnd()); CHECK_EQ(addr, addr & ~((64 << 10) - 1)); // windows wants 64K alignment diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp @@ -477,7 +477,7 @@ } void AfterSleep(ThreadState *thr, uptr pc) { - DPrintf("#%d: AfterSleep %zx\n", thr->tid); + DPrintf("#%d: AfterSleep\n", thr->tid); if (thr->ignore_sync) return; thr->last_sleep_stack_id = CurrentStackId(thr, pc); diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp @@ -538,8 +538,9 @@ // This function restores stack trace and mutex set for the thread/epoch. // It does so by getting stack trace and mutex set at the beginning of // trace part, and then replaying the trace till the given epoch. - DPrintf2("RestoreStack: tid=%u sid=%u@%u addr=0x%zx/%zu typ=%x\n", tid, sid, - epoch, addr, size, typ); + DPrintf2("RestoreStack: tid=%u sid=%u@%u addr=0x%zx/%zu typ=%x\n", tid, + static_cast(sid), static_cast(epoch), addr, size, + static_cast(typ)); ctx->slot_mtx.CheckLocked(); // needed to prevent trace part recycling ctx->thread_registry.CheckLocked(); ThreadContext *tctx = @@ -582,8 +583,8 @@ uptr ev_pc = prev_pc + ev->pc_delta - (1 << (EventAccess::kPCBits - 1)); prev_pc = ev_pc; - DPrintf2(" Access: pc=0x%zx addr=0x%llx/%llu type=%llu/%llu\n", - ev_pc, ev_addr, ev_size, ev->is_read, ev->is_atomic); + DPrintf2(" Access: pc=0x%zx addr=0x%zx/%zu type=%u/%u\n", ev_pc, + ev_addr, ev_size, ev->is_read, ev->is_atomic); if (match && type == EventType::kAccessExt && IsWithinAccess(addr, size, ev_addr, ev_size) && is_read == ev->is_read && is_atomic == ev->is_atomic && !is_free) @@ -593,7 +594,7 @@ if (evp->is_func) { auto *ev = reinterpret_cast(evp); if (ev->pc) { - DPrintf2(" FuncEnter: pc=0x%zx\n", ev->pc); + DPrintf2(" FuncEnter: pc=0x%llx\n", ev->pc); stack.PushBack(ev->pc); } else { DPrintf2(" FuncExit\n"); @@ -608,7 +609,7 @@ uptr ev_addr = RestoreAddr(ev->addr); uptr ev_size = 1 << ev->size_log; prev_pc = ev->pc; - DPrintf2(" AccessExt: pc=0x%zx addr=0x%llx/%llu type=%llu/%llu\n", + DPrintf2(" AccessExt: pc=0x%llx addr=0x%zx/%zu type=%u/%u\n", ev->pc, ev_addr, ev_size, ev->is_read, ev->is_atomic); if (match && type == EventType::kAccessExt && IsWithinAccess(addr, size, ev_addr, ev_size) && @@ -624,8 +625,8 @@ (ev->size_hi << EventAccessRange::kSizeLoBits) + ev->size_lo; uptr ev_pc = RestoreAddr(ev->pc); prev_pc = ev_pc; - DPrintf2(" Range: pc=0x%zx addr=0x%llx/%llu type=%llu/%llu\n", - ev_pc, ev_addr, ev_size, ev->is_read, ev->is_free); + DPrintf2(" Range: pc=0x%zx addr=0x%zx/%zu type=%u/%u\n", ev_pc, + ev_addr, ev_size, ev->is_read, ev->is_free); if (match && type == EventType::kAccessExt && IsWithinAccess(addr, size, ev_addr, ev_size) && is_read == ev->is_read && !is_atomic && is_free == ev->is_free) @@ -641,7 +642,7 @@ uptr ev_pc = RestoreAddr(ev->pc); StackID stack_id = (ev->stack_hi << EventLock::kStackIDLoBits) + ev->stack_lo; - DPrintf2(" Lock: pc=0x%zx addr=0x%llx stack=%u write=%d\n", ev_pc, + DPrintf2(" Lock: pc=0x%zx addr=0x%zx stack=%u write=%d\n", ev_pc, ev_addr, stack_id, is_write); mset.AddAddr(ev_addr, stack_id, is_write); // Events with ev_pc == 0 are written to the beginning of trace @@ -653,7 +654,7 @@ case EventType::kUnlock: { auto *ev = reinterpret_cast(evp); uptr ev_addr = RestoreAddr(ev->addr); - DPrintf2(" Unlock: addr=0x%llx\n", ev_addr); + DPrintf2(" Unlock: addr=0x%zx\n", ev_addr); mset.DelAddr(ev_addr); break; }