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/test | |
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/test')
-rw-r--r-- | lib/tools/test/fprof_SUITE.erl | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 244bdaaf0e..e18d384b52 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -985,10 +985,15 @@ handle_trace({trace_ts,Pid,spawn,NewPid,{M,F,Args},TS},P) -> MFA = {M,F,length(Args)}, ?dbg("~p",[{{spawn,Pid,NewPid,MFA},get(Pid)}]), T = ts_sub(TS,get({Pid,last_ts})), - put({NewPid,last_ts},TS), - put(NewPid,[suspend,MFA]), - insert(NewPid,suspend), - insert(NewPid,MFA), + case get(NewPid) of + undefined -> + put({NewPid,last_ts},TS), + put(NewPid,[suspend,MFA]), + insert(NewPid,suspend), + insert(NewPid,MFA); + _Else -> + ok + end, case get(Pid) of [SpawningMFA|_] = Stack -> update_own(Pid,SpawningMFA,T), @@ -996,6 +1001,19 @@ handle_trace({trace_ts,Pid,spawn,NewPid,{M,F,Args},TS},P) -> end, put({Pid,last_ts},TS), P; +handle_trace({trace_ts,NewPid,spawned,Pid,{M,F,Args},TS},P) -> + MFA = {M,F,length(Args)}, + ?dbg("~p",[{{spawned,NewPid,Pid,MFA},get(NewPid)}]), + case get(NewPid) of + undefined -> + put({NewPid,last_ts},TS), + put(NewPid,[suspend,MFA]), + insert(NewPid,suspend), + insert(NewPid,MFA); + _Else -> + ok + end, + P; handle_trace({trace_ts,Pid,exit,_Reason,TS},P) -> ?dbg("~p",[{{exit,Pid,_Reason},get(Pid)}]), T = ts_sub(TS,get({Pid,last_ts})), @@ -1023,6 +1041,7 @@ handle_trace(end_of_trace,P) -> P ! {result,[{totals,TotAcc,TotOwn}|ProcOwns]++Result}, P; handle_trace(Other,_P) -> + ct:log("Got unexpected trace message: ~p",[Other]), exit({unexpected,Other}). find_return_to(MFA,[MFA|_]=Stack) -> |