aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-12-15 12:25:08 +0100
committerDan Gudmundsson <[email protected]>2017-12-19 12:02:39 +0100
commitaf26ced299686400df79d32bf946081355e02aa2 (patch)
tree21597386820d7b870b1114b0a5147707c00eaa8e /lib
parent7f6ac587f47bd115604c7c9d1504e66cafffd265 (diff)
downloadotp-af26ced299686400df79d32bf946081355e02aa2.tar.gz
otp-af26ced299686400df79d32bf946081355e02aa2.tar.bz2
otp-af26ced299686400df79d32bf946081355e02aa2.zip
Turn on scheduler_wall_time in an alive process
scheduler_wall_time is ref-counted so it will turn off if process dies, keep the process that turns it on alive.
Diffstat (limited to 'lib')
-rw-r--r--lib/runtime_tools/src/observer_backend.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index 1b075a507d..a1edde8516 100644
--- a/lib/runtime_tools/src/observer_backend.erl
+++ b/lib/runtime_tools/src/observer_backend.erl
@@ -293,7 +293,7 @@ fetch_stats_loop(Parent, Time) ->
erlang:system_flag(scheduler_wall_time, true),
receive
_Msg ->
- %% erlang:system_flag(scheduler_wall_time, false)
+ erlang:system_flag(scheduler_wall_time, false),
ok
after Time ->
_M = Parent ! {stats, 1,
@@ -340,7 +340,6 @@ etop_collect(Collector) ->
case SchedulerWallTime of
undefined ->
- erlang:system_flag(scheduler_wall_time,true),
spawn(fun() -> flag_holder_proc(Collector) end),
ok;
_ ->
@@ -348,10 +347,11 @@ etop_collect(Collector) ->
end.
flag_holder_proc(Collector) ->
+ erlang:system_flag(scheduler_wall_time,true),
Ref = erlang:monitor(process,Collector),
receive
{'DOWN',Ref,_,_,_} ->
- %% erlang:system_flag(scheduler_wall_time,false)
+ erlang:system_flag(scheduler_wall_time,false),
ok
end.