tsan: uninline Enable/DisableIgnores
ScopedInterceptor::Enable/DisableIgnores is only used for some special cases. Unline them from the common interceptor handling. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D110157
This commit is contained in:
parent
db2f870fe3
commit
82e593cf90
|
|
@ -10,12 +10,22 @@ class ScopedInterceptor {
|
|||
public:
|
||||
ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc);
|
||||
~ScopedInterceptor();
|
||||
void DisableIgnores();
|
||||
void EnableIgnores();
|
||||
void DisableIgnores() {
|
||||
if (UNLIKELY(ignoring_))
|
||||
DisableIgnoresImpl();
|
||||
}
|
||||
void EnableIgnores() {
|
||||
if (UNLIKELY(ignoring_))
|
||||
EnableIgnoresImpl();
|
||||
}
|
||||
|
||||
private:
|
||||
ThreadState *const thr_;
|
||||
bool in_ignored_lib_;
|
||||
bool ignoring_;
|
||||
|
||||
void DisableIgnoresImpl();
|
||||
void EnableIgnoresImpl();
|
||||
};
|
||||
|
||||
LibIgnore *libignore();
|
||||
|
|
|
|||
|
|
@ -264,25 +264,25 @@ ScopedInterceptor::~ScopedInterceptor() {
|
|||
}
|
||||
}
|
||||
|
||||
void ScopedInterceptor::EnableIgnores() {
|
||||
if (ignoring_) {
|
||||
ThreadIgnoreBegin(thr_, 0);
|
||||
if (flags()->ignore_noninstrumented_modules) thr_->suppress_reports++;
|
||||
if (in_ignored_lib_) {
|
||||
DCHECK(!thr_->in_ignored_lib);
|
||||
thr_->in_ignored_lib = true;
|
||||
}
|
||||
NOINLINE
|
||||
void ScopedInterceptor::EnableIgnoresImpl() {
|
||||
ThreadIgnoreBegin(thr_, 0);
|
||||
if (flags()->ignore_noninstrumented_modules)
|
||||
thr_->suppress_reports++;
|
||||
if (in_ignored_lib_) {
|
||||
DCHECK(!thr_->in_ignored_lib);
|
||||
thr_->in_ignored_lib = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ScopedInterceptor::DisableIgnores() {
|
||||
if (ignoring_) {
|
||||
ThreadIgnoreEnd(thr_);
|
||||
if (flags()->ignore_noninstrumented_modules) thr_->suppress_reports--;
|
||||
if (in_ignored_lib_) {
|
||||
DCHECK(thr_->in_ignored_lib);
|
||||
thr_->in_ignored_lib = false;
|
||||
}
|
||||
NOINLINE
|
||||
void ScopedInterceptor::DisableIgnoresImpl() {
|
||||
ThreadIgnoreEnd(thr_);
|
||||
if (flags()->ignore_noninstrumented_modules)
|
||||
thr_->suppress_reports--;
|
||||
if (in_ignored_lib_) {
|
||||
DCHECK(thr_->in_ignored_lib);
|
||||
thr_->in_ignored_lib = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue