Skip to content

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:

  • trace init and finish
    • tsan_interface.cc:29 __tsan_init() --> we insert aser::ufo::init_ufo()
    • tsan_rtl.cc:409 Finalize() --> we insert aser::ufo::finish_ufo()
  • tsan_rtl.cc
    • line 468 ForkBefore() -> we insert aser::ufo::before_fork()
  • tsan_mman.cc
  • tsan_rtl_thread.cc
  • tsan+interceptors.cc
  • tsan_rtl_mutex.cc

Clone this wiki locally