anchor.diff:                              send_all(tl(Messages1))
                       end),
       DP = start_trace(message_receive_stats_script([Receiver1, Receiver2])),
  -    ?wait_for({line, {start}}),
  +    ?wait_for({line, ["start"]}),
       Sender1 ! {start, Receiver1},
       Sender2 ! {start, Receiver2},
       receive {'DOWN', Ref1, process, Receiver1, normal} -> ok end,
       receive {'DOWN', Ref2, process, Receiver2, normal} -> ok end,
       dyntrace_process:stop(DP),
       ?wait_for(eof),
  -    {Receiver1Str, Receiver2Str} = {?p2l(Receiver1), ?p2l(Receiver2)},
       [S1, S2, S3, S4, S5] = [?msize(M) || M <- Messages],
  -    {Min1, Avg1, Max1, Total1} =
  -        {?i2l(S1), ?i2l((S1+S2+S3) div 3), ?i2l(S3), ?i2l(S1+S2+S3)},
  -    {Min2, Avg2, Max2, Total2} =
  -        {?i2l(S5), ?i2l((S5+S4) div 2), ?i2l(S4), ?i2l(S4+S5)},
  -    %ct:log("~p~n~p~n", [{Min1, Avg1, Max1, Total1},
  -    %                    {Min2, Avg2, Max2, Total2}]),
  -    ?expect({line, {pid, Receiver1Str, "received", "3", "messages:",
  +    {Min1, Avg1, Max1, Total1} = {S1, (S1+S2+S3) div 3, S3, S1+S2+S3},
  +    {Min2, Avg2, Max2, Total2} = {S5, (S5+S4) div 2, S4, S4+S5},
  +    ?expect({line, ["pid", Receiver1, "received", 3, "messages:",
                       "min", Min1, "avg", Avg1,
  -                    "max", Max1, "total", Total1}}),
  -    ?expect({line, {pid, Receiver2Str, "received", "2", "messages:",
  +                    "max", Max1, "total", Total1]}),
  +    ?expect({line, ["pid", Receiver2, "received", 2, "messages:",
                       "min", Min2, "avg", Avg2,
  -                    "max", Max2, "total", Total2}}).
  +                    "max", Max2, "total", Total2]}).
   
   %%%-------------------------------------------------------------------
   %%% Test helpers
  
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: 
  begin_tick_end_test(_Config) ->
      DP = start_trace(begin_tick_end_script()),
      ?wait_for({line, ["start"]}),
      ?wait_for({line, ["ticked"]}),
      ?wait_for({line, ["ticked"]}),
      ?wait_for({line, ["ticked"]}),
      dyntrace_process:stop(DP),
      ?wait_for(eof),
      ?expect({line, ["finish"]}).
  
  variable_test(_Config) ->
      Messages = ["aa", "bbbb"],
      {Receiver, Ref} = spawn_monitor(fun() -> receive_all(Messages) end),
      Sender = spawn(fun() -> send_all(Messages) end),
      DP = start_trace(variable_script(Sender)),
      ?wait_for({line, ["start"]}),
      Sender ! {start, Receiver},
      receive {'DOWN', Ref, process, Receiver, normal} -> ok end,
      [Size1, Size2] = [?msize(M) || M <- Messages],
      TotalSize = Size1 + Size2,
      ?wait_for({line, ["sent", Sender, Receiver, Size1]}),
      ?wait_for({line, ["sent", Sender, Receiver, Size2]}),
      dyntrace_process:stop(DP),
      ?wait_for(eof),
      ?expect({line, ["last", Sender, Receiver, Size2]}),
      ?expect({line, ["total", "num", 2, "size", TotalSize]}),
      ct:log("~p~n",[self()]).
  
  count_messages_by_sender_test(_Config) ->
      {Receiver, Ref} = spawn_monitor(fun() -> receive_n(1, 30) end),
      Sender1 = spawn(fun() -> send_n(1, 10) end),
      Sender2 = spawn(fun() -> send_n(11, 30) end),
      DP = start_trace(count_messages_by_sender_script([Sender1, Sender2])),
      ?wait_for({line, ["start"]}),
      Sender1 ! {start, Receiver},
      Sender2 ! {start, Receiver},
      receive {'DOWN', Ref, process, Receiver, normal} -> ok end,
      dyntrace_process:stop(DP),
      ?wait_for(eof),
      ?expect({line, ["sent", 10, "from", Sender1]}),
      ?expect({line, ["sent", 20, "from", Sender2]}),
      ct:log("~p~n",[self()]).
  
  count_messages_by_sender_with_reset_test(_Config) ->
      {Receiver, Ref} = spawn_monitor(fun() -> receive_n(1, 30) end),
  