On Fri, Aug 21, 2015 at 12:59 PM, arunabh choudhary
<
arunab...@gmail.com> wrote:
> Hi Dmitry,
>
> Thank you again for your quick response.
>
> I am thinking to port tsan into ARM 32 bits architecture by de coupling
> events-log generation and actual data-race-detection algorithms. I like to
> know your thoughts on it. My idea is as follows.
>
>
>
> 1. Define memory layout for ARM 32 bits
>
> 2. Use tsan to log all events of interests (memory read, write,
> synchronization) into a file.
>
> 3. After execution is finished, analyze the event-log file for the data race
> using suitable algorithm.
That will work. We actually had such "offline" mode in the old
Valgrind-based tsan.
For that you will need to implement a separate runtime that implements
__tsan_read/write/func_entry/exit and interceptors that merely log
events into a file. And then you will need to implement an "offline"
tsan that reads the event log and feeds into tsan state machine.
Three potentially problematic moments:
1. I am not sure that it will be possible to directly reuse
tsan_interceptors for event collection; there can be assumption that
race detection happens online; or there can be very tight coupling
between the interceptors and state machine. That may require some
refactoring of interceptors and how they interact with the state
machine.
2. Similar issue for the state machine (tsan_rtl.cc); there can be
assumption that it runs online.
3. Scalable multi-threaded event collection may be non-trivial. You
want to allows threads to log in parallel for performance, but at the
same time you need to properly interleave per-thread event buffers on
synchronization events to preserve consistent order of events.
If you are serious about this, then please share the design and
prototypes with us early. The "offline" mode would be a useful
addition to tsan, but it needs to be implemented in a clean way (not
like tons of ifdefs sprinkled throughout tsan codebase).
Thank you