[llvm-commits] [compiler-rt] r167630 - in /compiler-rt/trunk/lib/tsan/rtl: tsan_interceptors.cc tsan_stat.cc tsan_stat.h
Dmitry Vyukov
dvyukov at google.com
Fri Nov 9 11:55:06 PST 2012
Author: dvyukov
Date: Fri Nov 9 13:55:06 2012
New Revision: 167630
URL: http://llvm.org/viewvc/llvm-project?rev=167630&view=rev
Log:
tsan: intercept gettimeofday()
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=167630&r1=167629&r2=167630&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Fri Nov 9 13:55:06 2012
@@ -1365,6 +1365,12 @@
thr->in_signal_handler = false;
}
+TSAN_INTERCEPTOR(int, gettimeofday, void *tv, void *tz) {
+ SCOPED_TSAN_INTERCEPTOR(gettimeofday, tv, tz);
+ // It's intercepted merely to process pending signals.
+ return REAL(gettimeofday)(tv, tz);
+}
+
namespace __tsan {
void InitializeInterceptors() {
@@ -1492,6 +1498,7 @@
TSAN_INTERCEPT(sleep);
TSAN_INTERCEPT(usleep);
TSAN_INTERCEPT(nanosleep);
+ TSAN_INTERCEPT(gettimeofday);
atexit_ctx = new(internal_alloc(MBlockAtExit, sizeof(AtExitContext)))
AtExitContext();
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc?rev=167630&r1=167629&r2=167630&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc Fri Nov 9 13:55:06 2012
@@ -197,6 +197,10 @@
name[StatInt_epoll_ctl] = " epoll_ctl ";
name[StatInt_epoll_wait] = " epoll_wait ";
name[StatInt_sigaction] = " sigaction ";
+ name[StatInt_sleep] = " sleep ";
+ name[StatInt_usleep] = " usleep ";
+ name[StatInt_nanosleep] = " nanosleep ";
+ name[StatInt_gettimeofday] = " gettimeofday ";
name[StatAnnotation] = "Dynamic annotations ";
name[StatAnnotateHappensBefore] = " HappensBefore ";
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h?rev=167630&r1=167629&r2=167630&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h Fri Nov 9 13:55:06 2012
@@ -203,6 +203,7 @@
StatInt_sleep,
StatInt_usleep,
StatInt_nanosleep,
+ StatInt_gettimeofday,
// Dynamic annotations.
StatAnnotation,
More information about the llvm-commits
mailing list