Correctness Proofs and Complexity Analysis of EventTrack Algorithm

Assumptions. Œe correctness proofs as well as complexity analysis presented here make an assumption related to the NO-PRE event-ordering rule presented in Table 1 of [2]. Œe NO-PRE rule states that for a pair of events e and e ′ posted to the same event queue, if an operation in the handler of e is found to happen before an operation in the handler of e ′ then end(e) ≺hb deq(e ′). Let function hbSrc(z) return the set of operations in the trace that happen before an operation z due to some HB rule except purely due to transitive closure. Typically, the set hbSrc(z) can be computed for an operation z in a trace τ just by inspecting the pre€x of τ upto the index of operation z in the trace. Œis makes vector clock based HB relation computation complexity linear in the number of operations in the trace. However, the presence of NO-PRE eventordering rule may cause EventTrack to HB order deq of an event e ′ w.r.t. end of an event e , only a‰er analyzing an operation y such that target(y) (de€ned in Table 3 in [2]) is an operation in the handler of e ′. Œis in turn may cause the operations in between deq(e ′) and y to be reprocessed to reƒect the new HB information obtained via end(e) in their respective vector clock timestamps. In general, computation of vector clock timestamps for operations in the program trace of a multi-threaded event-driven program like an Android application, may not complete in €xed number of passes over the trace. However we assume that the application of NO-PRE rule does not result in reprocessing of already processed operations in the input execution trace. We make this assumption when giving the correctness proofs and algorithm complexity, as we did not observe such trace reprocessing due to NO-PRE in our experimentation. However, our implementation of EventTrack handles such cases as well. We refer the readers to Section 3 of README.pdf at the root of EventTrack tool repository1 for more information about our implementation strategy to handle trace reprocessing due to NO-PRE.