Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit e767e35

Browse files
committed
asan: disable pthread_setname_np interceptor
it does not work anyway and can cause significant slowdown git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194711 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1170865 commit e767e35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/asan/asan_interceptors.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,13 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, void *)
144144
do { \
145145
} while (false)
146146
#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) SetThreadName(name)
147+
// Should be asanThreadRegistry().SetThreadNameByUserId(thread, name)
148+
// But asan does not remember UserId's for threads (pthread_t);
149+
// and remembers all ever existed threads, so the linear search by UserId
150+
// can be slow.
147151
#define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \
148-
asanThreadRegistry().SetThreadNameByUserId(thread, name)
152+
do { \
153+
} while (false)
149154
#define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name)
150155
#define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit()
151156
#include "sanitizer_common/sanitizer_common_interceptors.inc"

0 commit comments

Comments
 (0)