diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-11-27 11:30:28 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-11-27 11:30:28 +0000 |
commit | 6609d16e7c32ff6e78dacf6bc8fa47f23881fa51 (patch) | |
tree | 5a571e271b1adb54166d14999b3f13addb80d12d /lib/tsan/rtl/tsan_ignoreset.h | |
parent | eb7ad20d3eb55322bca5081a03b8e5271c4781d4 (diff) | |
download | compiler-rt-6609d16e7c32ff6e78dacf6bc8fa47f23881fa51.tar.gz |
tsan: better diagnostics if thread finishes with ignores enabled
print thread creation stack
and stacks where ignores were enabled.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_ignoreset.h')
-rw-r--r-- | lib/tsan/rtl/tsan_ignoreset.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_ignoreset.h b/lib/tsan/rtl/tsan_ignoreset.h new file mode 100644 index 000000000..e747d819c --- /dev/null +++ b/lib/tsan/rtl/tsan_ignoreset.h @@ -0,0 +1,38 @@ +//===-- tsan_ignoreset.h ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of ThreadSanitizer (TSan), a race detector. +// +// IgnoreSet holds a set of stack traces where ignores were enabled. +//===----------------------------------------------------------------------===// +#ifndef TSAN_IGNORESET_H +#define TSAN_IGNORESET_H + +#include "tsan_defs.h" + +namespace __tsan { + +class IgnoreSet { + public: + static const uptr kMaxSize = 16; + + IgnoreSet(); + void Add(u32 stack_id); + void Reset(); + uptr Size() const; + u32 At(uptr i) const; + + private: + uptr size_; + u32 stacks_[kMaxSize]; +}; + +} // namespace __tsan + +#endif // TSAN_IGNORESET_H |