summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_interface.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-05-10 13:48:04 +0000
committerKostya Serebryany <kcc@google.com>2012-05-10 13:48:04 +0000
commit7ac41484ea322e0ea5774df681660269f5dc321e (patch)
tree85fd49d59eebae20d3a82770431fd26478d2611b /lib/tsan/rtl/tsan_interface.h
parentf2b1df7cb8f53f51bcb105e0d2930d99325bb681 (diff)
downloadcompiler-rt-7ac41484ea322e0ea5774df681660269f5dc321e.tar.gz
compiler-rt-7ac41484ea322e0ea5774df681660269f5dc321e.tar.bz2
compiler-rt-7ac41484ea322e0ea5774df681660269f5dc321e.tar.xz
[tsan] First commit of ThreadSanitizer (TSan) run-time library.
Algorithm description: http://code.google.com/p/thread-sanitizer/wiki/ThreadSanitizerAlgorithm Status: The tool is known to work on large real-life applications, but still has quite a few rough edges. Nothing is guaranteed yet. The tool works on x86_64 Linux. Support for 64-bit MacOS 10.7+ is planned for late 2012. Support for 32-bit OSes is doable, but problematic and not yet planed. Further commits coming: - tests - makefiles - documentation - clang driver patch The code was previously developed at http://code.google.com/p/data-race-test/source/browse/trunk/v2/ by Dmitry Vyukov and Kostya Serebryany with contributions from Timur Iskhodzhanov, Alexander Potapenko, Alexey Samsonov and Evgeniy Stepanov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_interface.h')
-rw-r--r--lib/tsan/rtl/tsan_interface.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_interface.h b/lib/tsan/rtl/tsan_interface.h
new file mode 100644
index 00000000..ed21ec60
--- /dev/null
+++ b/lib/tsan/rtl/tsan_interface.h
@@ -0,0 +1,51 @@
+//===-- tsan_interface.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.
+//
+// The functions declared in this header will be inserted by the instrumentation
+// module.
+// This header can be included by the instrumented program or by TSan tests.
+//===----------------------------------------------------------------------===//
+#ifndef TSAN_INTERFACE_H
+#define TSAN_INTERFACE_H
+
+// This header should NOT include any other headers.
+// All functions in this header are extern "C" and start with __tsan_.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// This function should be called at the very beginning of the process,
+// before any instrumented code is executed and before any call to malloc.
+void __tsan_init();
+
+void __tsan_read1(void *addr);
+void __tsan_read2(void *addr);
+void __tsan_read4(void *addr);
+void __tsan_read8(void *addr);
+void __tsan_read16(void *addr);
+
+void __tsan_write1(void *addr);
+void __tsan_write2(void *addr);
+void __tsan_write4(void *addr);
+void __tsan_write8(void *addr);
+void __tsan_write16(void *addr);
+
+void __tsan_vptr_update(void **vptr_p, void *new_val);
+
+void __tsan_func_entry(void *call_pc);
+void __tsan_func_exit();
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // TSAN_INTERFACE_H