aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-03-19 17:39:14 +0100
committerJohn Högberg <[email protected]>2019-03-21 16:25:32 +0100
commit2f75782815441a161e6157c941b7f482f96bdbcb (patch)
tree1636fd286073f1fe669a9e3f6a477e23c62ea9bc /lib/observer/test
parent92bd7d3e43b7142d991f15594d783c1031547df5 (diff)
downloadotp-2f75782815441a161e6157c941b7f482f96bdbcb.tar.gz
otp-2f75782815441a161e6157c941b7f482f96bdbcb.tar.bz2
otp-2f75782815441a161e6157c941b7f482f96bdbcb.zip
seq_trace: Inherit trace token on spawn
Trace tokens can be lost when a process delegates message sending to a child process, which is pretty surprising and limits the usefulness of seq tracing. One example of this is gen_statem:call/4 which uses a child process to implement timeouts without the risk of a late message arriving to the caller. This commit attempts to remedy this by propagating the trace token to spawned processes, and adds optional tracing for process spawning as well.
Diffstat (limited to 'lib/observer/test')
-rw-r--r--lib/observer/test/ttb_SUITE.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl
index 33133dd78d..f8bb2e5eb0 100644
--- a/lib/observer/test/ttb_SUITE.erl
+++ b/lib/observer/test/ttb_SUITE.erl
@@ -658,11 +658,13 @@ seq_trace(Config) when is_list(Config) ->
?line ok = ttb:format(
[filename:join(Privdir,atom_to_list(Node)++"-seq_trace")]),
?line [{trace_ts,StartProc,call,{?MODULE,seq,[]},{_,_,_}},
- {seq_trace,0,{send,{0,1},StartProc,P1Proc,{Start,P2}}},
- {seq_trace,0,{send,{1,2},P1Proc,P2Proc,{P1,Start}}},
- {seq_trace,0,{send,{2,3},P2Proc,StartProc,{P2,P1}}},
+ {seq_trace,0,{send,{First, Seq0},StartProc,P1Proc,{Start,P2}}},
+ {seq_trace,0,{send,{Seq0, Seq1},P1Proc,P2Proc,{P1,Start}}},
+ {seq_trace,0,{send,{Seq1, Last},P2Proc,StartProc,{P2,P1}}},
end_of_trace] = flush(),
-
+ true = First < Seq0,
+ true = Seq0 < Seq1,
+ true = Seq1 < Last,
%% Additional test for metatrace
case StartProc of
{Start,_,_} -> ok;