summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2013-06-28 11:38:58 +0100
committerEmile Joubert <emile@rabbitmq.com>2013-06-28 11:38:58 +0100
commit457efdfc6b708e57d01f40f0328a8b5b7ed4bf66 (patch)
treece90e061fb804d24b26ed30a39d4a9fe54d98a9e
parentbefa23f9c56f8b857e13a63bad9ce3f75ed288fd (diff)
downloadrabbitmq-server-457efdfc6b708e57d01f40f0328a8b5b7ed4bf66.tar.gz
Move hipe modules list from macro to environment variable
-rw-r--r--ebin/rabbit_app.in27
-rw-r--r--src/rabbit.erl23
2 files changed, 28 insertions, 22 deletions
diff --git a/ebin/rabbit_app.in b/ebin/rabbit_app.in
index 339fa69e..a88c1a61 100644
--- a/ebin/rabbit_app.in
+++ b/ebin/rabbit_app.in
@@ -14,8 +14,7 @@
%% we also depend on crypto, public_key and ssl but they shouldn't be
%% in here as we don't actually want to start it
{mod, {rabbit, []}},
- {env, [{hipe_compile, false},
- {tcp_listeners, [5672]},
+ {env, [{tcp_listeners, [5672]},
{ssl_listeners, []},
{ssl_options, []},
{vm_memory_high_watermark, 0.4},
@@ -51,5 +50,27 @@
{backlog, 128},
{nodelay, true},
{linger, {true, 0}},
- {exit_on_close, false}]}
+ {exit_on_close, false}]},
+ {hipe_compile, false},
+ %% see bug 24513 for how this list was created
+ {hipe_modules, [rabbit_reader, rabbit_channel, gen_server2,
+ rabbit_exchange, rabbit_command_assembler,
+ rabbit_framing_amqp_0_9_1, rabbit_basic,
+ rabbit_event, lists, queue, priority_queue,
+ rabbit_router, rabbit_trace,
+ rabbit_misc, rabbit_binary_parser,
+ rabbit_exchange_type_direct, rabbit_guid,
+ rabbit_net, rabbit_amqqueue_process,
+ rabbit_variable_queue,
+ rabbit_binary_generator, rabbit_writer,
+ delegate, gb_sets, lqueue, sets, orddict,
+ rabbit_amqqueue, rabbit_limiter, gb_trees,
+ rabbit_queue_index, gen, dict, ordsets,
+ file_handle_cache, rabbit_msg_store, array,
+ rabbit_msg_store_ets_index, rabbit_msg_file,
+ rabbit_exchange_type_fanout,
+ rabbit_exchange_type_topic, mnesia,
+ mnesia_lib, rpc, mnesia_tm, qlc,
+ sofs, proplists, credit_flow, pmon,
+ ssl_connection, ssl_record, gen_fsm, ssl]}
]}]}.
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 31568ef5..dddf6f47 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -192,22 +192,6 @@
-define(APPS, [os_mon, mnesia, rabbit]).
-%% see bug 24513 for how this list was created
--define(HIPE_WORTHY,
- [rabbit_reader, rabbit_channel, gen_server2,
- rabbit_exchange, rabbit_command_assembler, rabbit_framing_amqp_0_9_1,
- rabbit_basic, rabbit_event, lists, queue, priority_queue,
- rabbit_router, rabbit_trace, rabbit_misc, rabbit_binary_parser,
- rabbit_exchange_type_direct, rabbit_guid, rabbit_net,
- rabbit_amqqueue_process, rabbit_variable_queue,
- rabbit_binary_generator, rabbit_writer, delegate, gb_sets, lqueue,
- sets, orddict, rabbit_amqqueue, rabbit_limiter, gb_trees,
- rabbit_queue_index, gen, dict, ordsets, file_handle_cache,
- rabbit_msg_store, array, rabbit_msg_store_ets_index, rabbit_msg_file,
- rabbit_exchange_type_fanout, rabbit_exchange_type_topic, mnesia,
- mnesia_lib, rpc, mnesia_tm, qlc, sofs, proplists, credit_flow, pmon,
- ssl_connection, ssl_record, gen_fsm, ssl]).
-
%% HiPE compilation uses multiple cores anyway, but some bits are
%% IO-bound so we can go faster if we parallelise a bit more. In
%% practice 2 processes seems just as fast as any other number > 1,
@@ -281,8 +265,9 @@ warn_if_hipe_compilation_failed(false) ->
%% long time, so make an exception to our no-stdout policy and display
%% progress via stdout.
hipe_compile() ->
- HipeWorthy = [HW || HW <- ?HIPE_WORTHY, code:which(HW) =/= non_existing],
- Count = length(HipeWorthy),
+ {ok, HipeModulesAll} = application:get_env(rabbit, hipe_modules),
+ HipeModules = [HM || HM <- HipeModulesAll, code:which(HM) =/= non_existing],
+ Count = length(HipeModules),
io:format("~nHiPE compiling: |~s|~n |",
[string:copies("-", Count)]),
T1 = erlang:now(),
@@ -291,7 +276,7 @@ hipe_compile() ->
io:format("#")
end || M <- Ms]
end) ||
- Ms <- split(HipeWorthy, ?HIPE_PROCESSES)],
+ Ms <- split(HipeModules, ?HIPE_PROCESSES)],
[receive
{'DOWN', MRef, process, _, normal} -> ok;
{'DOWN', MRef, process, _, Reason} -> exit(Reason)