diff options
author | Lukas Larsson <[email protected]> | 2016-02-26 09:18:39 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2016-04-15 15:07:56 +0200 |
commit | a67fd61a89ca7ab583612358918985d46746101e (patch) | |
tree | 1708b8b4e9a89b8c173e5bbef004aa4f148555e8 /lib/tools/src | |
parent | 3738103d0b1195e570a7525c4370cd490a5368aa (diff) | |
download | otp-a67fd61a89ca7ab583612358918985d46746101e.tar.gz otp-a67fd61a89ca7ab583612358918985d46746101e.tar.bz2 otp-a67fd61a89ca7ab583612358918985d46746101e.zip |
fprof: update to work with new spawned trace event
OTP-13499
Diffstat (limited to 'lib/tools/src')
-rw-r--r-- | lib/tools/src/fprof.erl | 15 |
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. |