aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src/observer_backend.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-04-27 12:21:26 +0200
committerSiri Hansen <[email protected]>2016-05-19 15:21:51 +0200
commiteeb094055101971ff94449cff08986126fb6add1 (patch)
tree7b3f69480da6d648378dbde6fbe2f252a2e1b1dc /lib/runtime_tools/src/observer_backend.erl
parentb41327bb7f006c1379301336b9b9d6c1e077f34e (diff)
downloadotp-eeb094055101971ff94449cff08986126fb6add1.tar.gz
otp-eeb094055101971ff94449cff08986126fb6add1.tar.bz2
otp-eeb094055101971ff94449cff08986126fb6add1.zip
[observer] Add Ports tab in GUI
Diffstat (limited to 'lib/runtime_tools/src/observer_backend.erl')
-rw-r--r--lib/runtime_tools/src/observer_backend.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index 66653c5b7f..cedb677178 100644
--- a/lib/runtime_tools/src/observer_backend.erl
+++ b/lib/runtime_tools/src/observer_backend.erl
@@ -23,7 +23,8 @@
-export([vsn/0]).
%% observer stuff
--export([sys_info/0, get_table/3, get_table_list/2, fetch_stats/2]).
+-export([sys_info/0, get_port_list/0,
+ get_table/3, get_table_list/2, fetch_stats/2]).
%% etop stuff
-export([etop_collect/1]).
@@ -139,6 +140,15 @@ get_mnesia_loop(Parent, {Match, Cont}) ->
Parent ! {self(), Match},
get_mnesia_loop(Parent, mnesia:select(Cont)).
+get_port_list() ->
+ [begin
+ [{port_id,P}|erlang:port_info(P)] ++
+ case erlang:port_info(P,monitors) of
+ undefined -> [];
+ Monitors -> [Monitors]
+ end
+ end || P <- erlang:ports()].
+
get_table_list(ets, Opts) ->
HideUnread = proplists:get_value(unread_hidden, Opts, true),
HideSys = proplists:get_value(sys_hidden, Opts, true),