summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_stat.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* tsan: remove some clock-related statsDmitry Vyukov2017-07-121-4/+1
| | | | | | | The stats are too dependent on implementation and won't be relevant in future. llvm-svn: 307786
* tsan: add new mutex annotationsDmitry Vyukov2017-03-261-0/+10
| | | | | | | | | | | | | | There are several problems with the current annotations (AnnotateRWLockCreate and friends): - they don't fully support deadlock detection (we need a hook _before_ mutex lock) - they don't support insertion of random artificial delays to perturb execution (again we need a hook _before_ mutex lock) - they don't support setting extended mutex attributes like read/write reentrancy (only "linker init" was bolted on) - they don't support setting mutex attributes if a mutex don't have a "constructor" (e.g. static, Java, Go mutexes) - they don't ignore synchronization inside of lock/unlock operations which leads to slowdown and false negatives The new annotations solve of the above problems. See tsan_interface.h for the interface specification and comments. Reviewed in https://reviews.llvm.org/D31093 llvm-svn: 298809
* tsan: fix a crashDmitry Vyukov2016-05-061-0/+1
| | | | | | | | | | | | | Fixes crash reported in: https://bugs.chromium.org/p/v8/issues/detail?id=4995 The problem is that we don't have a processor in a free interceptor during thread exit. The crash was introduced by introduction of Processors. However, previously we silently leaked memory which wasn't any better. llvm-svn: 268782
* tsan: speed up race deduplicationDmitry Vyukov2015-09-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Race deduplication code proved to be a performance bottleneck in the past if suppressions/annotations are used, or just some races left unaddressed. And we still get user complaints about this: https://groups.google.com/forum/#!topic/thread-sanitizer/hB0WyiTI4e4 ReportRace already has several layers of caching for racy pcs/addresses to make deduplication faster. However, ReportRace still takes a global mutex (ThreadRegistry and ReportMutex) during deduplication and also calls mmap/munmap (which take process-wide semaphore in kernel), this makes deduplication non-scalable. This patch moves race deduplication outside of global mutexes and also removes all mmap/munmap calls. As the result, race_stress.cc with 100 threads and 10000 iterations become 30x faster: before: real 0m21.673s user 0m5.932s sys 0m34.885s after: real 0m0.720s user 0m23.646s sys 0m1.254s http://reviews.llvm.org/D12554 llvm-svn: 246758
* tsan: optimize memory access functionsDmitry Vyukov2014-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The optimization is two-fold: First, the algorithm now uses SSE instructions to handle all 4 shadow slots at once. This makes processing faster. Second, if shadow contains the same access, we do not store the event into trace. This increases effective trace size, that is, tsan can remember up to 10x more previous memory accesses. Perofrmance impact: Before: [ OK ] DISABLED_BENCH.Mop8Read (2461 ms) [ OK ] DISABLED_BENCH.Mop8Write (1836 ms) After: [ OK ] DISABLED_BENCH.Mop8Read (1204 ms) [ OK ] DISABLED_BENCH.Mop8Write (976 ms) But this measures only fast-path. On large real applications the speedup is ~20%. Trace size impact: On app1: Memory accesses : 1163265870 Including same : 791312905 (68%) on app2: Memory accesses : 166875345 Including same : 150449689 (90%) 90% of filtered events means that trace size is effectively 10x larger. llvm-svn: 209897
* tsan: fix vector clocksDmitry Vyukov2014-04-111-2/+1
| | | | | | | the new optimizations break when thread ids gets reused (clocks go backwards) add the necessary tests as well llvm-svn: 206035
* tsan: optimize vector clock operationsDmitry Vyukov2014-03-241-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make vector clock operations O(1) for several important classes of use cases. See comments for details. Below are stats from a large server app, 77% of all clock operations are handled as O(1). Clock acquire : 25983645 empty clock : 6288080 fast from release-store : 14917504 contains my tid : 4515743 repeated (fast) : 2141428 full (slow) : 2636633 acquired something : 1426863 Clock release : 2544216 resize : 6241 fast1 : 197693 fast2 : 1016293 fast3 : 2007 full (slow) : 1797488 was acquired : 709227 clear tail : 1 last overflow : 0 Clock release store : 3446946 resize : 200516 fast : 469265 slow : 2977681 clear tail : 0 Clock acquire-release : 820028 llvm-svn: 204656
* [tsan] add coarse-grained lock around the DeadlockDetector. We can do better ↵Kostya Serebryany2014-02-211-0/+1
| | | | | | than that, but that's a start. llvm-svn: 201861
* tsan: remove interceptor statsDmitry Vyukov2014-01-281-351/+0
| | | | | | They seems to be unused, but cause maintenance pain. llvm-svn: 200308
* Sanitize printf functions.Alexey Samsonov2014-01-211-0/+20
| | | | | | | | | | Intercept and sanitize arguments passed to printf functions in ASan and TSan (don't do this in MSan for now). The checks are controlled by runtime flag (off by default for now). Patch http://llvm-reviews.chandlerc.com/D2480 by Yuri Gribov! llvm-svn: 199729
* [sanitizer] Intercept textdomain.Evgeniy Stepanov2013-12-021-0/+1
| | | | | | Patch by Alexander Taran. llvm-svn: 196098
* [sanitizer] Intercept times.Evgeniy Stepanov2013-11-281-0/+1
| | | | llvm-svn: 195918
* [sanitizer] Intercept iconv.Evgeniy Stepanov2013-11-281-0/+1
| | | | llvm-svn: 195917
* [sanitizer] Intercept __xpg_strerror_r.Evgeniy Stepanov2013-11-271-0/+1
| | | | llvm-svn: 195839
* [sanitizer] Intercept strptime.Evgeniy Stepanov2013-11-021-0/+1
| | | | llvm-svn: 193903
* [sanitizer] Intercept getline, getdelim.Evgeniy Stepanov2013-10-311-0/+2
| | | | llvm-svn: 193730
* [sanitizer] Intercept drand48_r, lrand48_r.Evgeniy Stepanov2013-10-291-0/+2
| | | | llvm-svn: 193655
* [sanitizer] Intercept sincos, remquo, lgamma, lgamma_r.Evgeniy Stepanov2013-10-291-0/+12
| | | | llvm-svn: 193645
* tsan/asan: support pthread_setname_np to set thread namesDmitry Vyukov2013-10-291-0/+1
| | | | llvm-svn: 193602
* [sanitizer] Intercept tmpnam, tmpnam_r, tempnam.Evgeniy Stepanov2013-10-251-0/+4
| | | | llvm-svn: 193415
* [sanitizer] Remove pthread_attr_getstackaddr interceptor.Evgeniy Stepanov2013-10-251-1/+0
| | | | | | The function is deprecated. llvm-svn: 193409
* [sanitizer] Intercept pthread_attr_get*.Evgeniy Stepanov2013-10-251-0/+10
| | | | llvm-svn: 193405
* [sanitizer] Intercept random_r.Evgeniy Stepanov2013-10-251-0/+1
| | | | llvm-svn: 193396
* [sanitizer] Intercept shmctl.Evgeniy Stepanov2013-10-241-0/+1
| | | | llvm-svn: 193348
* [sanitizer] Intercept ether_* functions.Evgeniy Stepanov2013-10-231-0/+7
| | | | llvm-svn: 193241
* [sanitizer] Intercept initgroups.Evgeniy Stepanov2013-10-221-0/+1
| | | | llvm-svn: 193158
* [sanitizer] Move statfs/fstatfs to common interceptors and add statvfs/fstatvfs.Evgeniy Stepanov2013-10-181-0/+8
| | | | llvm-svn: 192965
* [sanitizer] Intercept getmntent, getmntent_r.Evgeniy Stepanov2013-10-181-0/+2
| | | | llvm-svn: 192959
* tsan: add annotations to ignore synchronization operationsDmitry Vyukov2013-10-101-0/+2
| | | | | | | | The annotations are AnnotateIgnoreSyncBegin/End, may be useful to ignore some infrastructure synchronization that introduces lots of false negatives. llvm-svn: 192355
* tsan: intercept _exit so that we can override exit statusDmitry Vyukov2013-10-031-0/+1
| | | | llvm-svn: 191898
* tsan: ignore interceptors coming from specified librariesDmitry Vyukov2013-10-031-0/+2
| | | | | | | | | | | | | LibIgnore allows to ignore all interceptors called from a particular set of dynamic libraries. LibIgnore remembers all "called_from_lib" suppressions from the provided SuppressionContext; finds code ranges for the libraries; and checks whether the provided PC value belongs to the code ranges. Also make malloc and friends interceptors use SCOPED_INTERCEPTOR_RAW instead of SCOPED_TSAN_INTERCEPTOR, because if they are called from an ignored lib, then must call our internal allocator instead of libc malloc. llvm-svn: 191897
* [sanitizer] Intercept backtrace, backtrace_symbols.Evgeniy Stepanov2013-09-271-0/+2
| | | | llvm-svn: 191516
* [sanitizer] A bunch of libc interceptors.Evgeniy Stepanov2013-09-251-0/+7
| | | | | | | | | | | | sigwait sigwaitinfo sigtimedwait sigemptyset sigfillset sigpending sigprocmask llvm-svn: 191374
* [sanitizer] Intercept wordexp.Evgeniy Stepanov2013-09-241-0/+1
| | | | llvm-svn: 191305
* tsan: ignore malloc/free/strdup when called from libjvmDmitry Vyukov2013-09-211-0/+1
| | | | llvm-svn: 191153
* tsan: fix linking of tsan runtime into dynamic librariesDmitry Vyukov2013-09-191-6/+6
| | | | | | | versioned symbols can not be linked into dynamic library w/o linker script also simplifies code as side effect llvm-svn: 191056
* tsan: properly intercept pthread_cond functionsDmitry Vyukov2013-09-021-6/+6
| | | | llvm-svn: 189767
* [sanitizer] Intercept poll/ppoll.Evgeniy Stepanov2013-08-121-0/+1
| | | | llvm-svn: 188177
* [sanitizer] Intercept getgroups.Evgeniy Stepanov2013-08-121-0/+1
| | | | llvm-svn: 188167
* [sanitizer] Intercept scandir/scandir64.Evgeniy Stepanov2013-08-081-0/+2
| | | | llvm-svn: 187982
* [sanitizer] Intercept strerror and strerror_r.Evgeniy Stepanov2013-08-081-0/+2
| | | | llvm-svn: 187978
* [sanitizer] Intercept sched_getaffinity.Evgeniy Stepanov2013-08-071-0/+1
| | | | | | Re-applying with a more reliable test case. llvm-svn: 187876
* Revert "[sanitizer] Intercept sched_getaffinity."David Blaikie2013-08-071-1/+0
| | | | | | | | | | | | This reverts commit r187788. The test case is unreliable (as the test may be run in a situation in which it has no affinity with cpu0). This can be recommitted with a more reliable test - possibly using CPU_COUNT != 0 instead (I wasn't entirely sure that a process was guaranteed to have at least one affinity, though it seems reasonable, or I'd have made the change myself). llvm-svn: 187841
* [sanitizer] Intercept sched_getaffinity.Evgeniy Stepanov2013-08-061-0/+1
| | | | llvm-svn: 187788
* [msan] Intercept confstr.Evgeniy Stepanov2013-07-301-0/+1
| | | | llvm-svn: 187412
* tsan: support sigsuspend() callDmitry Vyukov2013-07-161-0/+1
| | | | | | Intercepting it makes it process pending signal before return. llvm-svn: 186400
* [sanitizer] Intercept realpath and canonicalize_file_name.Evgeniy Stepanov2013-07-091-0/+2
| | | | | | Handle realpath(path, NULL) form. llvm-svn: 185921
* [sanitizer] Intercept tcgetattr.Evgeniy Stepanov2013-07-041-0/+1
| | | | llvm-svn: 185626
* [sanitizer] More interceptors.Evgeniy Stepanov2013-07-041-0/+8
| | | | | | | | | bcopy strtoimax, strtoumax mbstowcs, mbsrtowcs, mbsnrtowcs wcstombs, wcsrtombs, wcsnrtombs llvm-svn: 185624
OpenPOWER on IntegriCloud