aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-07-10 16:41:44 +0200
committerBjörn-Egil Dahlberg <[email protected]>2013-07-15 17:01:35 +0200
commitd3d5908a516f4d01ae80534b9ecf336b266d1788 (patch)
treec96bfa3bb324ed010a492ea5561b5a36dfe4eb80 /lib/runtime_tools/src
parenta1129128cec73cddd4f64c915a7dd7a85171c417 (diff)
downloadotp-d3d5908a516f4d01ae80534b9ecf336b266d1788.tar.gz
otp-d3d5908a516f4d01ae80534b9ecf336b266d1788.tar.bz2
otp-d3d5908a516f4d01ae80534b9ecf336b266d1788.zip
Add beam dynamic libraries to system_information
Diffstat (limited to 'lib/runtime_tools/src')
-rw-r--r--lib/runtime_tools/src/system_information.erl23
1 files changed, 20 insertions, 3 deletions
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.