aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tools/src')
-rw-r--r--lib/tools/src/fprof.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/tools/src/fprof.erl b/lib/tools/src/fprof.erl
index c5c24c8eb3..f9da748fef 100644
--- a/lib/tools/src/fprof.erl
+++ b/lib/tools/src/fprof.erl
@@ -1567,13 +1567,20 @@ trace_handler({trace_ts, Pid, return_to, {_M, _F, Args} = MFArgs, TS} = Trace,
trace_return_to(Table, Pid, Func, TS),
TS;
%%
-%% spawn
+%% spawn, only needed (and reliable) prior to 19.0
trace_handler({trace_ts, Pid, spawn, Child, MFArgs, TS} = Trace,
Table, _, Dump) ->
dump_stack(Dump, get(Pid), Trace),
trace_spawn(Table, Child, MFArgs, TS, Pid),
TS;
%%
+%% spawned, added in 19.0
+trace_handler({trace_ts, Pid, spawned, Parent, MFArgs, TS} = Trace,
+ Table, _, Dump) ->
+ dump_stack(Dump, get(Pid), Trace),
+ trace_spawn(Table, Pid, MFArgs, TS, Parent),
+ TS;
+%%
%% exit
trace_handler({trace_ts, Pid, exit, _Reason, TS} = Trace,
Table, _, Dump) ->
@@ -2014,8 +2021,10 @@ trace_spawn(Table, Pid, MFArgs, TS, Parent) ->
ets:insert(Table, #proc{id = Pid, parent = Parent,
spawned_as = MFArgs});
_ ->
- throw({inconsistent_trace_data, ?MODULE, ?LINE,
- [Pid, MFArgs, TS, Parent, Stack]})
+ %% In 19.0 we get both a spawn and spawned event,
+ %% however we do not know the order so we just ignore
+ %% the second event that comes
+ ok
end.