aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-04-29 08:58:27 +0200
committerSiri Hansen <[email protected]>2016-05-19 15:21:52 +0200
commitcd14e151f84926cbdd1243b62ef5478681f56369 (patch)
tree8367c2bf5b6bb1bea3660d30aab1dc4f314c9a18
parent5ddc361d6652fb5aa7a7ac6ad06be95f16f0030d (diff)
downloadotp-cd14e151f84926cbdd1243b62ef5478681f56369.tar.gz
otp-cd14e151f84926cbdd1243b62ef5478681f56369.tar.bz2
otp-cd14e151f84926cbdd1243b62ef5478681f56369.zip
[observer] In Trace tab, show procs/ports for selected node only
Earlier, all traced processes and ports would be shown, independent of selected nodes in node view. This is now corrected.
-rw-r--r--lib/observer/src/observer_trace_wx.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index f5211c8a31..ac8c6cdc4f 100644
--- a/lib/observer/src/observer_trace_wx.erl
+++ b/lib/observer/src/observer_trace_wx.erl
@@ -198,6 +198,7 @@ create_proc_port_view(Parent) ->
wxListCtrl:connect(Procs, command_list_item_right_click),
wxListCtrl:connect(Ports, command_list_item_right_click),
wxListCtrl:connect(Nodes, command_list_item_right_click),
+ wxListCtrl:connect(Nodes, command_list_item_selected),
wxListCtrl:connect(Procs, size, [{skip, true}]),
wxListCtrl:connect(Ports, size, [{skip, true}]),
wxListCtrl:connect(Nodes, size, [{skip, true}]),
@@ -295,6 +296,15 @@ handle_event(#wx{id=?MODULES_WIN, event=#wxList{type=command_list_item_selected,
update_functions_view(dict:fetch(Module, TPs), Fview),
{noreply, State};
+handle_event(#wx{id=?NODES_WIN,
+ event=#wxList{type=command_list_item_selected, itemIndex=Row}},
+ State = #state{tpids=Tpids, tports=Tports, n_view=Nview,
+ proc_view=ProcView, port_view=PortView}) ->
+ Node = list_to_atom(wxListCtrl:getItemText(Nview, Row)),
+ update_p_view(Tpids, ProcView, Node),
+ update_p_view(Tports, PortView, Node),
+ {noreply, State};
+
handle_event(#wx{event = #wxCommand{type = command_togglebutton_clicked, commandInt = 1}},
#state{panel = Panel,
nodes = Nodes,
@@ -679,6 +689,13 @@ do_add_pid_or_port(POpts, Nview, LCtrl, OldPs, Ns0, Check) ->
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+update_p_view(PidsOrPorts0, LCtrl, Node) ->
+ %% Show processes/ports belonging to the given node,
+ %% and processes/ports traced by name
+ PidsOrPorts = [P || P <- PidsOrPorts0,
+ is_atom(P#titem.id) orelse node(P#titem.id)==Node],
+ update_p_view(PidsOrPorts,LCtrl).
+
update_p_view(PidsOrPorts, LCtrl) ->
%% pid- or port-view
wxListCtrl:deleteAllItems(LCtrl),