diff options
author | Rickard Green <[email protected]> | 2018-04-13 14:33:38 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2018-05-16 13:28:46 +0200 |
commit | 78f639da759cd3f8b5f28bc86ec404f3c3db60f4 (patch) | |
tree | 1e449df42cf4bd3e840a10de105a4646d19136e9 /erts/emulator/beam/erl_trace.c | |
parent | 08873ec673ef223a4e0c9826b0370d80bb6aad24 (diff) | |
download | otp-78f639da759cd3f8b5f28bc86ec404f3c3db60f4.tar.gz otp-78f639da759cd3f8b5f28bc86ec404f3c3db60f4.tar.bz2 otp-78f639da759cd3f8b5f28bc86ec404f3c3db60f4.zip |
New process suspend implementation based on async signaling
Diffstat (limited to 'erts/emulator/beam/erl_trace.c')
-rw-r--r-- | erts/emulator/beam/erl_trace.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c index 065a560b52..f074dd8bdb 100644 --- a/erts/emulator/beam/erl_trace.c +++ b/erts/emulator/beam/erl_trace.c @@ -2629,6 +2629,38 @@ erts_tracer_to_term(Process *p, ErtsTracer tracer) } } +Eterm +erts_build_tracer_to_term(Eterm **hpp, ErlOffHeap *ohp, Uint *szp, ErtsTracer tracer) +{ + Eterm res; + Eterm state; + Uint sz; + + if (ERTS_TRACER_IS_NIL(tracer)) + return am_false; + + state = ERTS_TRACER_STATE(tracer); + sz = is_immed(state) ? 0 : size_object(state); + + if (szp) + *szp += sz; + + if (hpp) + res = is_immed(state) ? state : copy_struct(state, sz, hpp, ohp); + else + res = THE_NON_VALUE; + + if (ERTS_TRACER_MODULE(tracer) != am_erl_tracer) { + if (szp) + *szp += 3; + if (hpp) { + res = TUPLE2(*hpp, ERTS_TRACER_MODULE(tracer), res); + *hpp += 3; + } + } + + return res; +} static ERTS_INLINE int send_to_tracer_nif_raw(Process *c_p, Process *tracee, |