llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.h

#ifndef TSAN_INTERCEPTORS_H
#define TSAN_INTERCEPTORS_H

#include "sanitizer_common/sanitizer_stacktrace.h"
#include "tsan_rtl.h"

namespace __tsan {

class ScopedInterceptor {};

struct TsanInterceptorContext {};

LibIgnore *libignore();

#if !SANITIZER_GO
inline bool in_symbolizer() {}
#endif

inline bool MustIgnoreInterceptor(ThreadState *thr) {}

}  // namespace __tsan

#define SCOPED_INTERCEPTOR_RAW(func, ...)

#ifdef __powerpc64__
// Debugging of crashes on powerpc after commit:
// c80604f7a3 ("tsan: remove real func check from interceptors")
// Somehow replacing if with DCHECK leads to strange failures in:
// SanitizerCommon-tsan-powerpc64le-Linux :: Linux/ptrace.cpp
// https://lab.llvm.org/buildbot/#/builders/105
// https://lab.llvm.org/buildbot/#/builders/121
// https://lab.llvm.org/buildbot/#/builders/57
#define CHECK_REAL_FUNC
#else
#define CHECK_REAL_FUNC(func)
#endif

#define SCOPED_TSAN_INTERCEPTOR(func, ...)

#define SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START()

#define SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END()

#define TSAN_INTERCEPTOR(ret, func, ...)

#if SANITIZER_FREEBSD
#define TSAN_INTERCEPTOR_FREEBSD_ALIAS
#else
#define TSAN_INTERCEPTOR_FREEBSD_ALIAS(ret, func, ...)
#endif

#if SANITIZER_NETBSD
#define TSAN_INTERCEPTOR_NETBSD_ALIAS
#define TSAN_INTERCEPTOR_NETBSD_ALIAS_THR
#define TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2
#else
#define TSAN_INTERCEPTOR_NETBSD_ALIAS(ret, func, ...)
#define TSAN_INTERCEPTOR_NETBSD_ALIAS_THR(ret, func, ...)
#define TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2(ret, func, func2, ...)
#endif

#define COMMON_INTERCEPT_FUNCTION(name)

#define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED

#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size)

#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size)

#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...)

#endif  // TSAN_INTERCEPTORS_H