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 /erts/emulator/beam/erl_gc.c | |
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 'erts/emulator/beam/erl_gc.c')
-rw-r--r-- | erts/emulator/beam/erl_gc.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index 4698458521..df5d0f4918 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -593,10 +593,6 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end, esdp = erts_get_scheduler_data(); - if (IS_TRACED_FL(p, F_TRACE_GC)) { - trace_gc(p, am_gc_start); - } - erts_smp_atomic32_read_bor_nob(&p->state, ERTS_PSFLG_GC); if (erts_system_monitor_long_gc != 0) start_time = erts_get_monotonic_time(esdp); @@ -619,18 +615,29 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end, */ if (GEN_GCS(p) < MAX_GEN_GCS(p) && !(FLAGS(p) & F_NEED_FULLSWEEP)) { - DTRACE2(gc_minor_start, pidbuf, need); - reds = minor_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now); - DTRACE2(gc_minor_end, pidbuf, reclaimed_now); - if (reds < 0) - goto do_major_collection; - } - else { - do_major_collection: + if (IS_TRACED_FL(p, F_TRACE_GC)) { + trace_gc(p, am_gc_minor_start, need); + } + DTRACE2(gc_minor_start, pidbuf, need); + reds = minor_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now); + DTRACE2(gc_minor_end, pidbuf, reclaimed_now); + if (IS_TRACED_FL(p, F_TRACE_GC)) { + trace_gc(p, am_gc_minor_end, reclaimed_now); + } + if (reds < 0) + goto do_major_collection; + } else { +do_major_collection: ERTS_MSACC_SET_STATE_CACHED_M_X(ERTS_MSACC_STATE_GC_FULL); - DTRACE2(gc_major_start, pidbuf, need); - reds = major_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now); - DTRACE2(gc_major_end, pidbuf, reclaimed_now); + if (IS_TRACED_FL(p, F_TRACE_GC)) { + trace_gc(p, am_gc_major_start, need); + } + DTRACE2(gc_major_start, pidbuf, need); + reds = major_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now); + DTRACE2(gc_major_end, pidbuf, reclaimed_now); + if (IS_TRACED_FL(p, F_TRACE_GC)) { + trace_gc(p, am_gc_major_end, reclaimed_now); + } ERTS_MSACC_SET_STATE_CACHED_M_X(ERTS_MSACC_STATE_GC); } @@ -646,10 +653,6 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end, erts_smp_atomic32_read_band_nob(&p->state, ~ERTS_PSFLG_GC); - if (IS_TRACED_FL(p, F_TRACE_GC)) { - trace_gc(p, am_gc_end); - } - if (erts_system_monitor_long_gc != 0) { ErtsMonotonicTime end_time; Uint gc_time; |