summaryrefslogtreecommitdiff
path: root/src/rabbit.erl
diff options
context:
space:
mode:
authorJean-Sebastien Pedron <jean-sebastien@rabbitmq.com>2014-11-26 12:35:49 +0100
committerJean-Sebastien Pedron <jean-sebastien@rabbitmq.com>2014-11-26 12:35:49 +0100
commit5122b4cc7a74bea9fe0a00bf4ac3c818b1f4259c (patch)
tree41591f55ad2f85295f212fd087078d662e5e68ea /src/rabbit.erl
parent0a0299358b96e674db55218586b177b852c24e5b (diff)
downloadrabbitmq-server-5122b4cc7a74bea9fe0a00bf4ac3c818b1f4259c.tar.gz
During startup, log statistics after modules were hipe-compiled
A similar message was already displayed on stdout. A warning was also logged when HiPE was desired but unavailable. To be consistent with the "HiPE enabled" case, the same warning is now displayed on stdout too.
Diffstat (limited to 'src/rabbit.erl')
-rw-r--r--src/rabbit.erl17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 664da206..ca1d5ba8 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -243,15 +243,19 @@ maybe_hipe_compile() ->
{ok, Want} = application:get_env(rabbit, hipe_compile),
Can = code:which(hipe) =/= non_existing,
case {Want, Can} of
- {true, true} -> hipe_compile(),
- true;
+ {true, true} -> hipe_compile();
{true, false} -> false;
- {false, _} -> true
+ {false, _} -> {ok, disabled}
end.
-warn_if_hipe_compilation_failed(true) ->
+warn_if_hipe_compilation_failed({ok, disabled}) ->
ok;
+warn_if_hipe_compilation_failed({ok, Count, Duration}) ->
+ rabbit_log:info(
+ "HiPE in use: compiled ~B modules in ~Bs.~n", [Count, Duration]);
warn_if_hipe_compilation_failed(false) ->
+ io:format(
+ "~nNot HiPE compiling: HiPE not found in this Erlang installation.~n"),
rabbit_log:warning(
"Not HiPE compiling: HiPE not found in this Erlang installation.~n").
@@ -276,8 +280,9 @@ hipe_compile() ->
{'DOWN', MRef, process, _, Reason} -> exit(Reason)
end || {_Pid, MRef} <- PidMRefs],
T2 = erlang:now(),
- io:format("|~n~nCompiled ~B modules in ~Bs~n",
- [Count, timer:now_diff(T2, T1) div 1000000]).
+ Duration = timer:now_diff(T2, T1) div 1000000,
+ io:format("|~n~nCompiled ~B modules in ~Bs~n", [Count, Duration]),
+ {ok, Count, Duration}.
split(L, N) -> split0(L, [[] || _ <- lists:seq(1, N)]).