[PATCH] [Tsan] Do not intercept non-FreeBSD functions on FreeBSD
Dmitry Vyukov
dvyukov at google.com
Fri Oct 24 01:39:48 PDT 2014
I am proposing something in between:
#if SANITIZER_LINUX
TSAN_INTERCEPTOR(int, epoll_create, int size) {
SCOPED_TSAN_INTERCEPTOR(epoll_create, size);
int fd = REAL(epoll_create)(size);
if (fd >= 0)
FdPollCreate(thr, pc, fd);
return fd;
}
#define TSAN_MAYBE_INTERCEPT_EPOLL_CREATE TSAN_INTERCEPT(epoll_create)
#else
#define TSAN_MAYBE_INTERCEPT_EPOLL_CREATE
#endif
void InitializeInterceptors() {
...
TSAN_MAYBE_INTERCEPT_EPOLL_CREATE;
The original version indeed has unnecessary duplication of information. And the current version has unnecessary dissipation of information -- I need to update 3 places to add an interceptor, and when I am looking at an interceptor I can't understand when it's enabled (TSAN_INTERCEPT_TMPFILE64 name is pointless and does not communicate any useful information to me).
http://reviews.llvm.org/D5858
More information about the llvm-commits
mailing list