@@ -183,7 +183,7 @@ single_pid_with_msg(_Config) ->
183183msg_after_traced_call (_Config ) ->
184184 Pid = spawn_link (fun ? MODULE :async_factorial /0 ),
185185 MFA = {? MODULE , factorial , 1 },
186- tr :trace (#{modules => [MFA ], msg => all }),
186+ tr :trace (#{modules => [MFA ], pids => [ Pid ], msg => all }),
187187 Self = self (),
188188 Pid ! {do_factorial , 0 , Self },
189189 receive {ok , _ } -> ok end ,
@@ -693,8 +693,9 @@ trace_fib3() ->
693693
694694trace_wait_and_reply () ->
695695 Self = self (),
696- tr :trace (#{modules => [MFA = {? MODULE , wait_and_reply , 1 }], msg => all }),
697- Pid = spawn_link (? MODULE , wait_and_reply , [self ()]),
696+ Pid = spawn_wait_and_reply (self ()),
697+ tr :trace (#{modules => [MFA = {? MODULE , wait_and_reply , 1 }], pids => [Pid ], msg => all }),
698+ Pid ! start ,
698699 receive {started , Pid } -> ok end ,
699700 Pid ! reply ,
700701 receive {finished , Pid } -> ok end ,
@@ -759,6 +760,12 @@ fib(N) when N > 1 -> fib(N - 1) + fib(N - 2);
759760fib (1 ) -> 1 ;
760761fib (0 ) -> 0 .
761762
763+ spawn_wait_and_reply (Sender ) ->
764+ spawn_link (fun () ->
765+ receive start -> ok end ,
766+ wait_and_reply (Sender )
767+ end ).
768+
762769wait_and_reply (Sender ) ->
763770 Sender ! {started , self ()},
764771 receive reply -> ok end ,
0 commit comments