-
Notifications
You must be signed in to change notification settings - Fork 18
3. UFO Tracing In Depth
Andrew Chin edited this page May 2, 2019
·
4 revisions
During runtime, when an event occurs (memory reads and writes, function entry and exit, memory allocation and deallocation, thread creation, start, end, and join, condition wait and signal, mutex lock and unlock, and fork), TSan calls a function to track races (although TSan is focused on memory reads/writes). By inserting calls to the UFO tracing library in these functions, we can generate traces as a program executes. Here are the locations of the calls we insert into the TSan RTL:
-
tsan_interface.cc
- line 29
__tsan_init()--> we insertaser::ufo::init_ufo()
- line 29
-
tsan_rtl.cc
- line 409
Finalize()--> we insertaser::ufo::finish_ufo() - line 468
ForkBefore()--> we insertaser::ufo::before_fork() - line 778
MemoryAccess()--> we insertaser::ufo::on_mem_acc() - line 968
FuncEntry()--> we insertaser::ufo::enter_func() - line 996
FuncExit()--> we insertaser::ufo::exit_func()
- line 409
-
tsan_mman.cc
- line 193
OnUserAlloc()--> we insertaser::ufo::on_alloc() - line 206
OnUserFree()--> we insertaser::ufo::on_dealloc()
- line 193
-
tsan_rtl_thread.cc
- line 55
OnCreated()--> we insertaser::ufo::on_thread_created() - line 96
OnStarted()--> we insertaser::ufo::on_thread_start() - line 287
ThreadFinish()--> we insertaser::ufo::on_thread_end() - line 316
ThreadJoin()--> we insertaser::ufo::on_thread_join()
- line 55
-
tsan_interceptors.cc
- line 1052 we intercept
pthread_cond_wait()--> we insertaser::ufo::on_cond_wait() - line 1080 we intercept
pthread_cond_signal()--> we insertaser::ufo::on_cond_signal()
- line 1052 we intercept
-
tsan_rtl_mutex.cc
- line 59
MutexPostLock()--> we insertaser::ufo::on_mtx_lock() - line 219
MutexUnlock()--> we insertaser::ufo::on_mtx_unlock()
- line 59