aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-02-10 11:10:18 +0100
committerSiri Hansen <[email protected]>2016-02-10 11:13:35 +0100
commit8fba155bdc0b45f0504756d1ea695d9c53a44f80 (patch)
tree20743b3da8707882935c995c77e05b2da9ed7c29 /lib/sasl
parent439292ad4afe73243852fe79d5d467c325f382bf (diff)
parent264a5e804d6e23bf6c6916887669760cbf243caa (diff)
downloadotp-8fba155bdc0b45f0504756d1ea695d9c53a44f80.tar.gz
otp-8fba155bdc0b45f0504756d1ea695d9c53a44f80.tar.bz2
otp-8fba155bdc0b45f0504756d1ea695d9c53a44f80.zip
Merge branch 'nybek/speed_up_supervisor_count_children' into maint
* nybek/speed_up_supervisor_count_children: Speed up supervisor:count_children/1; simple_one_for_one Add supervisor:get_callback_module/1 OTP-13290
Diffstat (limited to 'lib/sasl')
-rw-r--r--lib/sasl/src/release_handler_1.erl33
-rw-r--r--lib/sasl/src/sasl.app.src2
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl2
3 files changed, 4 insertions, 33 deletions
diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl
index 5e9a35ab4c..a6325270a5 100644
--- a/lib/sasl/src/release_handler_1.erl
+++ b/lib/sasl/src/release_handler_1.erl
@@ -676,48 +676,19 @@ maybe_get_dynamic_mods(Name, Pid) ->
error(get_modules_failed)
end.
-%% XXXX
-%% Note: The following is a terrible hack done in order to resolve the
-%% problem stated in ticket OTP-3452.
-
-%% XXXX NOTE WELL: This record is from supervisor.erl. Also the record
-%% name is really `state'.
--record(supervisor_state, {name,
- strategy,
- children = [],
- dynamics = [],
- intensity,
- period,
- restarts = [],
- module,
- args}).
-
%% Return the name of the call-back module that implements the
%% (top) supervisor SupPid.
%% Returns: {ok, Module} | {error,undefined}
%%
get_supervisor_module(SupPid) ->
- case catch get_supervisor_module1(SupPid) of
- {ok, Module} when is_atom(Module) ->
+ case catch supervisor:get_callback_module(SupPid) of
+ Module when is_atom(Module) ->
{ok, Module};
_Other ->
io:format("~w: reason: ~w~n", [SupPid, _Other]),
{error, undefined}
end.
-get_supervisor_module1(SupPid) ->
- {status, _Pid, {module, _Mod},
- [_PDict, _SysState, _Parent, _Dbg, Misc]} = sys:get_status(SupPid),
- %% supervisor Misc field changed at R13B04, handle old and new variants here
- State = case Misc of
- [_Name, State1, _Type, _Time] ->
- State1;
- [_Header, _Data, {data, [{"State", State2}]}] ->
- State2
- end,
- %% Cannot use #supervisor_state{module = Module} = State.
- {ok, element(#supervisor_state.module, State)}.
-
%%-----------------------------------------------------------------
%% Func: do_soft_purge/3
%% Args: Mod = atom()
diff --git a/lib/sasl/src/sasl.app.src b/lib/sasl/src/sasl.app.src
index 705bb73fc5..507e2dc229 100644
--- a/lib/sasl/src/sasl.app.src
+++ b/lib/sasl/src/sasl.app.src
@@ -46,6 +46,6 @@
{env, [{sasl_error_logger, tty},
{errlog_type, all}]},
{mod, {sasl, []}},
- {runtime_dependencies, ["tools-2.6.14","stdlib-2.6","kernel-4.1",
+ {runtime_dependencies, ["tools-2.6.14","stdlib-2.8","kernel-4.1",
"erts-6.0"]}]}.
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index d57de2593a..ee620dcdb4 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -1363,7 +1363,7 @@ upgrade_supervisor(Conf) when is_list(Conf) ->
%% Check that the restart strategy and child spec is updated
{status, _, {module, _}, [_, _, _, _, [_,_,{data,[{"State",State}]}]]} =
rpc:call(Node,sys,get_status,[a_sup]),
- {state,_,RestartStrategy,[Child],_,_,_,_,_,_} = State,
+ {state,_,RestartStrategy,[Child],_,_,_,_,_,_,_} = State,
one_for_all = RestartStrategy, % changed from one_for_one
{child,_,_,_,_,brutal_kill,_,_} = Child, % changed from timeout 2000