anchor.diff:                               send_n(36, 40) end),
       DP = start_trace(
              count_messages_by_sender_and_receiver_script([Sender1, Sender2])),
  -    ?wait_for({line, {start}}),
  +    ?wait_for({line, ["start"]}),
       Sender1 ! {start, Receiver1},
       Sender2 ! {start, Receiver1},
       receive {'DOWN', Ref1, process, Receiver1, normal} -> ok end,
       receive {'DOWN', Ref2, process, Receiver2, normal} -> ok end,
       dyntrace_process:stop(DP),
       ?wait_for(eof),
  -    {Sender1Str, Sender2Str} = {?p2l(Sender1), ?p2l(Sender2)},
  -    {Receiver1Str, Receiver2Str} = {?p2l(Receiver1), ?p2l(Receiver2)},
  -    ?expect({line, {sent, "10", "from", Sender1Str, "to", Receiver1Str}}),
  -    ?expect({line, {sent, "1",  "from", Sender1Str, "to", Sender1Str}}),
  -    ?expect({line, {sent, "5",  "from", Sender1Str, "to", Receiver2Str}}),
  -    ?expect({line, {sent, "20", "from", Sender2Str, "to", Receiver1Str}}),
  -    ?expect({line, {sent, "1",  "from", Sender2Str, "to", Sender2Str}}),
  -    ?expect({line, {sent, "5",  "from", Sender2Str, "to", Receiver2Str}}).
  +    ?expect({line, ["sent", 10, "from", Sender1, "to", Receiver1]}),
  +    ?expect({line, ["sent", 1,  "from", Sender1, "to", Sender1]}),
  +    ?expect({line, ["sent", 5,  "from", Sender1, "to", Receiver2]}),
  +    ?expect({line, ["sent", 20, "from", Sender2, "to", Receiver1]}),
  +    ?expect({line, ["sent", 1,  "from", Sender2, "to", Sender2]}),
  +    ?expect({line, ["sent", 5,  "from", Sender2, "to", Receiver2]}).
   
   count_messages_up_down_test(_Config) ->
  -    Ps = ring_start(4),
  +    [A, B, C, D] = Ps = ring_start(4),
       DP = start_trace(count_messages_up_down_script(Ps)),
  -    ?wait_for({line, {start}}),
  +    ?wait_for({line, ["start"]}),
       Ref1 = ring_send(Ps, 10, self()),
       Ref2 = ring_send(lists:reverse(Ps), 5, self()),
       receive {finished, Ref1} -> ok end,
       receive {finished, Ref2} -> ok end,
       dyntrace_process:stop(DP),
       ring_stop(Ps),
  -    [A, B, C, D] = [?p2l(P) || P <- Ps],
  -    ?wait_for(eof),
  -    ?expect({line, {sent, "up", "10", "down", "5", "from", A, "to", B}}),
  -    ?expect({line, {sent, "up", "10", "down", "5", "from", B, "to", C}}),
  -    ?expect({line, {sent, "up", "10", "down", "5", "from", C, "to", D}}),
  -    ?expect({line, {sent, "up", "5", "down", "10", "from", A, "to", D}}).
  +    ?wait_for(eof),
  +    ?expect({line, ["sent", "up", 10, "down", 5, "from", A, "to", B]}),
  +    ?expect({line, ["sent", "up", 10, "down", 5, "from", B, "to", C]}),
  +    ?expect({line, ["sent", "up", 10, "down", 5, "from", C, "to", D]}),
  +    ?expect({line, ["sent", "up", 5, "down", 10, "from", A, "to", D]}).
   
   sender_and_receiver_set_test(_Config) ->
  -    Ps = ring_start(3),
  +    [A, B, C] = Ps = ring_start(3),
       DP = start_trace(sender_and_receiver_set_script(Ps)),
  -    ?wait_for({line, {start}}),
  +    ?wait_for({line, ["start"]}),
       Ref1 = ring_send(Ps, 1, self()),
       Ref2 = ring_send(tl(Ps), 1, self()),
       receive {finished, Ref1} -> ok end,
       receive {finished, Ref2} -> ok end,
       dyntrace_process:stop(DP),
       ring_stop(Ps),
  -    [A, B, C] = [?p2l(P) || P <- Ps],
  -    ?wait_for(eof),
  -    ?expect({line, {sent, "from", A, "to", B}}),
  -    ?expect({line, {sent, "from", B, "to", C}}),
  -    ?expect({line, {sent, "from", C, "to", A}}),
  -    ?expect({line, {sent, "from", C, "to", B}}),
  -    ?expect_not({line, {sent, "from", B, "to", A}}),
  -    ?expect_not({line, {sent, "from", A, "to", C}}).
  +    ?wait_for(eof),
  +    ?expect({line, ["sent", "from", A, "to", B]}),
  +    ?expect({line, ["sent", "from", B, "to", C]}),
  +    ?expect({line, ["sent", "from", C, "to", A]}),
  +    ?expect({line, ["sent", "from", C, "to", B]}),
  +    ?expect_not({line, ["sent", "from", B, "to", A]}),
  +    ?expect_not({line, ["sent", "from", A, "to", C]}).
   
   message_receive_stats_test(_Config) ->
       Messages = ["1", "222", "33333333", "44444", "55"],
  
positive.code:     Sender2 = spawn(fun() -> send_n(6, 20), send_n(21, 30) end),
      DP = start_trace(
             count_messages_by_sender_with_reset_script([Sender1, Sender2])),
      ?wait_for({line, {start}}),
      Sender1 ! {start, Receiver},
      Sender2 ! {start, Receiver},
      {Sender1Str, Sender2Str} = {?p2l(Sender1), ?p2l(Sender2)},
      ?wait_for({line, {sent, "5", "from", Sender1Str}}),
      ?wait_for({line, {sent, "15", "from", Sender2Str}}),
      Sender2 ! {start, Receiver},
      receive {'DOWN', Ref, process, Receiver, normal} -> ok end,
      ?wait_for({line, {sent, "10", "from", Sender2Str}}),
      dyntrace_process:stop(DP),
      ?wait_for(eof),
      ?expect_not({line, {sent, _, _, _}}).
  
  count_messages_by_sender_and_receiver_test(_Config) ->
      {Receiver1, Ref1} = spawn_monitor(fun() -> receive_n(1, 30) end),
  
negative.code:     end.
  
  termify_line(L) ->
      [termify_token(Token) || Token <- re:split(L, " ", [{return,list}])].
  
  termify_token(L) ->
      try list_to_integer(L)
      catch error:badarg ->
              try list_to_pid(L)
              catch error:badarg -> L
              end
      end.
  
  ring_start(ProcNum) ->
      lists:sort([spawn(fun ring_proc/0) || _ <- lists:seq(1, ProcNum)]).
  