diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-04-29 18:36:22 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-29 18:36:22 +0200 |
commit | a8667f3fcdd4ee1f59f4826d148dd0838680eda9 (patch) | |
tree | 74cd7f5a1c6c282d76c07362cee96f0b8ad46793 /lib/tools | |
parent | 47b6c981fb461a4b85444ce9dd072b64937e4b84 (diff) | |
parent | 535aec73c5af7c7e2f48f29ad35d2319d91b9c90 (diff) | |
download | otp-a8667f3fcdd4ee1f59f4826d148dd0838680eda9.tar.gz otp-a8667f3fcdd4ee1f59f4826d148dd0838680eda9.tar.bz2 otp-a8667f3fcdd4ee1f59f4826d148dd0838680eda9.zip |
Merge branch 'egil/erts/tracing-support-lttng/OTP-13532'
* egil/erts/tracing-support-lttng/OTP-13532: (28 commits)
runtime_tools: User's guide to LTTng and dyntrace
runtime_tools: Fix Dtrace build
erts: Fix gc messages in tracer_SUITE
erts: Fix gc messages in sensitive_SUITE
erts: Fix gc messages in trace_port_SUITE
tools: Update fprof tests
tools: Update fprof with new gc traces
runtime_tools: Update dyntrace_lttng_SUITE tests
runtime_tools: Add 'return_to' for call tracing
erts: Fix return_to trace callback
erts: Update erl_tracer documentation
erts: Fix erl_tracer documentation typos
Update preloaded erl_tracer.beam
erts: Update erl_tracer type specs
runtime_tools: Add lttng dyntrace tests
runtime_tools: Extend 'trace' and 'enabled' tracer callbacks
erts: Extend 'enabled' and 'trace' tracer callbacks
runtime_tools: Extend 'enabled' tracer callbacks
erts: Extend 'enabled' tracer callbacks
runtime_tools: Update lttng garbage collection trace
...
Diffstat (limited to 'lib/tools')
-rw-r--r-- | lib/tools/src/fprof.erl | 17 | ||||
-rw-r--r-- | lib/tools/test/fprof_SUITE.erl | 40 |
2 files changed, 49 insertions, 8 deletions
diff --git a/lib/tools/src/fprof.erl b/lib/tools/src/fprof.erl index f9da748fef..b21eedc625 100644 --- a/lib/tools/src/fprof.erl +++ b/lib/tools/src/fprof.erl @@ -1629,15 +1629,24 @@ trace_handler({trace_ts, Pid, in, {_M, _F, Args} = MFArgs, TS} = Trace, TS; %% %% gc_start -trace_handler({trace_ts, Pid, gc_start, _Func, TS} = Trace, - Table, _, Dump) -> +trace_handler({trace_ts, Pid, gc_minor_start, _Func, TS} = Trace, Table, _, Dump) -> + dump_stack(Dump, get(Pid), Trace), + trace_gc_start(Table, Pid, TS), + TS; + +trace_handler({trace_ts, Pid, gc_major_start, _Func, TS} = Trace, Table, _, Dump) -> dump_stack(Dump, get(Pid), Trace), trace_gc_start(Table, Pid, TS), TS; + %% %% gc_end -trace_handler({trace_ts, Pid, gc_end, _Func, TS} = Trace, - Table, _, Dump) -> +trace_handler({trace_ts, Pid, gc_minor_end, _Func, TS} = Trace, Table, _, Dump) -> + dump_stack(Dump, get(Pid), Trace), + trace_gc_end(Table, Pid, TS), + TS; + +trace_handler({trace_ts, Pid, gc_major_end, _Func, TS} = Trace, Table, _, Dump) -> dump_stack(Dump, get(Pid), Trace), trace_gc_end(Table, Pid, TS), TS; diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index e18d384b52..affb45b7a6 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -949,8 +949,8 @@ handle_trace({trace_ts,Pid,return_to,MFA,TS},P) -> end, put({Pid,last_ts},TS), P; -handle_trace({trace_ts,Pid,gc_start,_,TS},P) -> - ?dbg("~p",[{{gc_start,Pid},get(Pid)}]), +handle_trace({trace_ts,Pid,gc_minor_start,_,TS},P) -> + ?dbg("~p",[{{gc_minor_start,Pid},get(Pid)}]), case get(Pid) of [suspend|_] = Stack -> T = ts_sub(TS,get({Pid,last_ts})), @@ -970,8 +970,40 @@ handle_trace({trace_ts,Pid,gc_start,_,TS},P) -> end, put({Pid,last_ts},TS), P; -handle_trace({trace_ts,Pid,gc_end,_,TS},P) -> - ?dbg("~p",[{{gc_end,Pid},get(Pid)}]), +handle_trace({trace_ts,Pid,gc_major_start,_,TS},P) -> + ?dbg("~p",[{{gc_minor_start,Pid},get(Pid)}]), + case get(Pid) of + [suspend|_] = Stack -> + T = ts_sub(TS,get({Pid,last_ts})), + insert(Pid,garbage_collect), + update_acc(Pid,Stack,T), + put(Pid,[garbage_collect|Stack]); + [CallingMFA|_] = Stack -> + T = ts_sub(TS,get({Pid,last_ts})), + insert(Pid,garbage_collect), + update_own(Pid,CallingMFA,T), + update_acc(Pid,Stack,T), + put(Pid,[garbage_collect|Stack]); + undefined -> + put(first_ts,TS), + put(Pid,[garbage_collect]), + insert(Pid,garbage_collect) + end, + put({Pid,last_ts},TS), + P; +handle_trace({trace_ts,Pid,gc_minor_end,_,TS},P) -> + ?dbg("~p",[{{gc_minor_end,Pid},get(Pid)}]), + T = ts_sub(TS,get({Pid,last_ts})), + case get(Pid) of + [garbage_collect|RestOfStack] = Stack -> + update_own(Pid,garbage_collect,T), + update_acc(Pid,Stack,T), + put(Pid,RestOfStack) + end, + put({Pid,last_ts},TS), + P; +handle_trace({trace_ts,Pid,gc_major_end,_,TS},P) -> + ?dbg("~p",[{{gc_major_end,Pid},get(Pid)}]), T = ts_sub(TS,get({Pid,last_ts})), case get(Pid) of [garbage_collect|RestOfStack] = Stack -> |