diff options
| author | Kostya Serebryany <kcc@google.com> | 2014-03-21 13:00:18 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2014-03-21 13:00:18 +0000 |
| commit | 3df5d87da48e8f2c7d94c14159037ec597cf3d86 (patch) | |
| tree | fdaf359e761314fc0ce27b6ce20ca8dc61f66816 /compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc | |
| parent | 11164bdaf57e2fd3bc66775a2a7512f28e37ef4e (diff) | |
| download | bcm5719-llvm-3df5d87da48e8f2c7d94c14159037ec597cf3d86.tar.gz bcm5719-llvm-3df5d87da48e8f2c7d94c14159037ec597cf3d86.zip | |
[sanitizer] print threads in deadlock report
llvm-svn: 204461
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc index 7b52a93af17..73c5daf5957 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc @@ -39,6 +39,9 @@ struct Callback : DDCallback { virtual u32 Unwind() { return CurrentStackId(thr, pc); } + virtual int UniqueTid() { + return thr->unique_id; + } }; void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) { @@ -411,8 +414,11 @@ void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r) { return; ThreadRegistryLock l(ctx->thread_registry); ScopedReport rep(ReportTypeDeadlock); - for (int i = 0; i < r->n; i++) + for (int i = 0; i < r->n; i++) { rep.AddMutex(r->loop[i].mtx_ctx0); + rep.AddUniqueTid((int)r->loop[i].thr_ctx); + rep.AddThread((int)r->loop[i].thr_ctx); + } StackTrace stacks[2 * DDReport::kMaxLoopSize]; uptr dummy_pc = 0x42; for (int i = 0; i < r->n; i++) { |

