aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src/observer_backend.erl
diff options
context:
space:
mode:
authorSiri Hansen <siri@erlang.org>2013-02-26 10:56:36 +0100
committerSiri Hansen <siri@erlang.org>2013-03-04 11:05:33 +0100
commit0756a6676d465862056a0fb0969eee827f1a844d (patch)
treea2e6d5fbd295edea49c2065afb480bceee3e1fd6 /lib/runtime_tools/src/observer_backend.erl
parent8183fcfb059794823a8289456d68b20a80d9a1b4 (diff)
downloadotp-0756a6676d465862056a0fb0969eee827f1a844d.tar.gz
otp-0756a6676d465862056a0fb0969eee827f1a844d.tar.bz2
otp-0756a6676d465862056a0fb0969eee827f1a844d.zip
[observer] Fix non tail-recusive loop when measuring scheduler utilization
Diffstat (limited to 'lib/runtime_tools/src/observer_backend.erl')
-rw-r--r--lib/runtime_tools/src/observer_backend.erl11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index 9498412505..e8c9b50c33 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-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2013. 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
@@ -199,20 +199,19 @@ get_table_list(mnesia, Opts) ->
lists:foldl(Info, [], mnesia:system_info(tables)).
fetch_stats(Parent, Time) ->
- erlang:system_flag(scheduler_wall_time, true),
process_flag(trap_exit, true),
- fetch_stats_loop(Parent, Time),
- erlang:system_flag(scheduler_wall_time, false).
+ fetch_stats_loop(Parent, Time).
fetch_stats_loop(Parent, Time) ->
+ erlang:system_flag(scheduler_wall_time, true),
receive
- _Msg -> normal
+ _Msg -> erlang:system_flag(scheduler_wall_time, false)
after Time ->
_M = Parent ! {stats, 1,
erlang:statistics(scheduler_wall_time),
erlang:statistics(io),
erlang:memory()},
- fetch_stats(Parent, Time)
+ fetch_stats_loop(Parent, Time)
end.
%%
%% etop backend