From d3d5908a516f4d01ae80534b9ecf336b266d1788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 10 Jul 2013 16:41:44 +0200 Subject: Add beam dynamic libraries to system_information --- lib/runtime_tools/src/system_information.erl | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/runtime_tools/src/system_information.erl b/lib/runtime_tools/src/system_information.erl index 5b7afda8f6..5c6516f72f 100644 --- a/lib/runtime_tools/src/system_information.erl +++ b/lib/runtime_tools/src/system_information.erl @@ -30,9 +30,7 @@ -export([ report/0, from_file/1, - to_file/1, - code/0, - get_value/2 + to_file/1 ]). -export([ start/0, stop/0, @@ -84,6 +82,7 @@ report() -> [ {code, code()}, {system_info, erlang_system_info()}, {erts_compile_info, erlang:system_info(compile_info)}, + {beam_dynamic_libraries, get_dynamic_libraries()}, {environment_erts, os_getenv_erts_specific()}, {environment, [split_env(Env) || Env <- os:getenv()]} ]. @@ -456,3 +455,21 @@ get_compiler_version(B) -> proplists:get_value(version, Info); _ -> undefined end. + +get_dynamic_libraries() -> + Beam = filename:join([os:getenv("BINDIR"),get_beam_name()]), + case os:type() of + {unix, darwin} -> os:cmd("otool -L " ++ Beam); + _ -> os:cmd("ldd " ++ Beam) + end. + +get_beam_name() -> + Type = case erlang:system_info(build_type) of + opt -> ""; + TypeName -> "." ++ atom_to_list(TypeName) + end, + Flavor = case erlang:system_info(smp_support) of + false -> ""; + true -> ".smp" + end, + os:getenv("EMU") ++ Type ++ Flavor. -- cgit v1.2.3