diff options
author | Dan Gudmundsson <[email protected]> | 2014-02-20 12:21:33 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-02-20 12:21:33 +0100 |
commit | ae8e71d0f5fc999f2631c4878ebde0aac233641f (patch) | |
tree | 7204d385d7aa15a82f9fc801dc0f45c905511f72 /lib | |
parent | a1631b173c977b5903e26a2bed36f9b32fe5b4d5 (diff) | |
parent | 265998a7e412cd382315632964846569c370a5a2 (diff) | |
download | otp-ae8e71d0f5fc999f2631c4878ebde0aac233641f.tar.gz otp-ae8e71d0f5fc999f2631c4878ebde0aac233641f.tar.bz2 otp-ae8e71d0f5fc999f2631c4878ebde0aac233641f.zip |
Merge branch 'dgud/runtime_tools/scheduler_wall_time_flags/OTP-11693'
* dgud/runtime_tools/scheduler_wall_time_flags/OTP-11693:
runtime_tools: Do not turn off scheduler_wall_time
Diffstat (limited to 'lib')
-rw-r--r-- | lib/runtime_tools/src/observer_backend.erl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl index 68ef04f20c..fea0854042 100644 --- a/lib/runtime_tools/src/observer_backend.erl +++ b/lib/runtime_tools/src/observer_backend.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2013. All Rights Reserved. +%% Copyright Ericsson AB 2002-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -227,7 +227,9 @@ fetch_stats(Parent, Time) -> fetch_stats_loop(Parent, Time) -> erlang:system_flag(scheduler_wall_time, true), receive - _Msg -> erlang:system_flag(scheduler_wall_time, false) + _Msg -> + %% erlang:system_flag(scheduler_wall_time, false) + ok after Time -> _M = Parent ! {stats, 1, erlang:statistics(scheduler_wall_time), @@ -244,17 +246,6 @@ etop_collect(Collector) -> %% utilization in etop). Next time the flag will be true and then %% there will be a measurement. SchedulerWallTime = erlang:statistics(scheduler_wall_time), - - %% Turn off the flag while collecting data per process etc. - case erlang:system_flag(scheduler_wall_time,false) of - false -> - %% First time and the flag was false - start a monitoring - %% process to set the flag back to false when etop is stopped. - spawn(fun() -> flag_holder_proc(Collector) end); - _ -> - ok - end, - ProcInfo = etop_collect(processes(), []), Collector ! {self(),#etop_info{now = now(), @@ -264,13 +255,22 @@ etop_collect(Collector) -> memi = etop_memi(), procinfo = ProcInfo }}, + + case SchedulerWallTime of + undefined -> + spawn(fun() -> flag_holder_proc(Collector) end); + _ -> + ok + end, + erlang:system_flag(scheduler_wall_time,true). flag_holder_proc(Collector) -> Ref = erlang:monitor(process,Collector), receive {'DOWN',Ref,_,_,_} -> - erlang:system_flag(scheduler_wall_time,false) + %% erlang:system_flag(scheduler_wall_time,false) + ok end. etop_memi() -> |