[tsan] Track external tags in thread traces
authorKuba Mracek <mracek@apple.com>
Sun, 30 Apr 2017 20:35:18 +0000 (20:35 +0000)
committerKuba Mracek <mracek@apple.com>
Sun, 30 Apr 2017 20:35:18 +0000 (20:35 +0000)
commit5a195f4fc5b44902e01bed24c487e283411b658e
tree0ae7406ddcfd5f7f15bc14cebd8baaae3bd74a26
parent08989c7ecda18fc570299d6080868b6d3da921b0
[tsan] Track external tags in thread traces

To make the TSan external API work with Swift and other use cases, we need to track "tags" for individual memory accesses. Since there is no space to store this information in shadow cells, let's use the thread traces for that. This patch stores the tag as an extra frame in the stack traces (by calling FuncEntry and FuncExit with the address of a registered tag), this extra frame is then stripped before printing the backtrace to stderr.

Differential Revision: https://reviews.llvm.org/D32382

llvm-svn: 301777
compiler-rt/lib/tsan/go/buildgo.sh
compiler-rt/lib/tsan/rtl/tsan_external.cc
compiler-rt/lib/tsan/rtl/tsan_report.cc
compiler-rt/lib/tsan/rtl/tsan_rtl.h
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc