diff options
author | Kuba Mracek <mracek@apple.com> | 2017-02-02 12:54:21 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-02-02 12:54:21 +0000 |
commit | a8936412d7753e7d885a4ccb60036bb18901c57f (patch) | |
tree | 160e455e2df3eff87f5b1c18af8f5f3b51982971 /lib/sanitizer_common/sanitizer_thread_registry.h | |
parent | ee21d1338198a9eb2b15e0b48409752e69bd7901 (diff) |
[tsan] Properly describe GCD worker threads in reports
When dealing with GCD worker threads, TSan currently prints weird things like "created by thread T-1" and "[failed to restore the stack]" in reports. This patch avoids that and instead prints "Thread T3 (...) is a GCD worker thread".
Differential Revision: https://reviews.llvm.org/D29103
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_thread_registry.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_thread_registry.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_thread_registry.h b/lib/sanitizer_common/sanitizer_thread_registry.h index a27bbb376..17b1d5d90 100644 --- a/lib/sanitizer_common/sanitizer_thread_registry.h +++ b/lib/sanitizer_common/sanitizer_thread_registry.h @@ -45,6 +45,7 @@ class ThreadContextBase { ThreadStatus status; bool detached; + bool workerthread; u32 parent_tid; ThreadContextBase *next; // For storing thread contexts in a list. @@ -54,7 +55,7 @@ class ThreadContextBase { void SetDead(); void SetJoined(void *arg); void SetFinished(); - void SetStarted(uptr _os_id, void *arg); + void SetStarted(uptr _os_id, bool _workerthread, void *arg); void SetCreated(uptr _user_id, u64 _unique_id, bool _detached, u32 _parent_tid, void *arg); void Reset(); @@ -115,7 +116,7 @@ class ThreadRegistry { void DetachThread(u32 tid, void *arg); void JoinThread(u32 tid, void *arg); void FinishThread(u32 tid); - void StartThread(u32 tid, uptr os_id, void *arg); + void StartThread(u32 tid, uptr os_id, bool workerthread, void *arg); private: const ThreadContextFactory context_factory_; |