aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer
diff options
context:
space:
mode:
authorSiri Hansen <siri@erlang.org>2016-05-12 15:40:32 +0200
committerSiri Hansen <siri@erlang.org>2016-05-20 09:40:56 +0200
commitebd440bfc9eb685606250a82cae352f1ee37dac6 (patch)
treedcab06a86f1d83b91c8bad145c992c002471882b /lib/observer
parent705011b8a223630d9800de9bd4d5cfd0b5986879 (diff)
downloadotp-ebd440bfc9eb685606250a82cae352f1ee37dac6.tar.gz
otp-ebd440bfc9eb685606250a82cae352f1ee37dac6.tar.bz2
otp-ebd440bfc9eb685606250a82cae352f1ee37dac6.zip
[observer] Allow more trace flags on procs/ports from GUI
Diffstat (limited to 'lib/observer')
-rw-r--r--lib/observer/src/observer_trace_wx.erl3
-rw-r--r--lib/observer/src/observer_traceoptions_wx.erl20
-rw-r--r--lib/observer/src/ttb.erl3
3 files changed, 21 insertions, 5 deletions
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index f104f5bb19..7df599c602 100644
--- a/lib/observer/src/observer_trace_wx.erl
+++ b/lib/observer/src/observer_trace_wx.erl
@@ -1023,7 +1023,8 @@ dbg_flag(proc,on_link) -> sol;
dbg_flag(proc,on_first_spawn) -> sofs;
dbg_flag(proc,on_first_link) -> sofl;
dbg_flag(proc,events) -> p;
-dbg_flag(port,events) -> ports.
+dbg_flag(port,events) -> ports;
+dbg_flag(_,Flag) -> Flag.
textformat(Trace) when element(1, Trace) == trace_ts, tuple_size(Trace) >= 4 ->
format_trace(Trace, tuple_size(Trace)-1, element(tuple_size(Trace),Trace));
diff --git a/lib/observer/src/observer_traceoptions_wx.erl b/lib/observer/src/observer_traceoptions_wx.erl
index e623f90df3..285c298c4b 100644
--- a/lib/observer/src/observer_traceoptions_wx.erl
+++ b/lib/observer/src/observer_traceoptions_wx.erl
@@ -36,12 +36,20 @@ process_trace(Parent, Default) ->
FuncBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace function call", []),
check_box(FuncBox, lists:member(functions, Default)),
+ ArityBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace arity instead of arguments", []),
+ check_box(ArityBox, lists:member(functions, Default)),
SendBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace send message", []),
check_box(SendBox, lists:member(send, Default)),
RecBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace receive message", []),
check_box(RecBox, lists:member('receive', Default)),
EventBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace process events", []),
check_box(EventBox, lists:member(events, Default)),
+ SchedBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace scheduling of processes", []),
+ check_box(SchedBox, lists:member(running_procs, Default)),
+ ExitBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace scheduling of exiting processes", []),
+ check_box(ExitBox, lists:member(exiting, Default)),
+ GCBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace garbage collections", []),
+ check_box(GCBox, lists:member(garbage_collection, Default)),
{SpawnBox, SpwnAllRadio, SpwnFirstRadio} =
optionpage_top_right(Panel, RightSz, [{flag, ?wxBOTTOM},{border, 5}], "spawn"),
@@ -57,7 +65,7 @@ process_trace(Parent, Default) ->
{Radio, Opt} <- [{SpwnAllRadio, on_spawn}, {SpwnFirstRadio, on_first_spawn},
{LinkAllRadio, on_link}, {LinkFirstRadio, on_first_link}]],
- [wxSizer:add(LeftSz, CheckBox, []) || CheckBox <- [FuncBox,SendBox,RecBox,EventBox]],
+ [wxSizer:add(LeftSz, CheckBox, []) || CheckBox <- [FuncBox,ArityBox,SendBox,RecBox,EventBox,SchedBox,ExitBox,GCBox]],
wxSizer:add(LeftSz, 150, -1),
wxSizer:add(PanelSz, LeftSz, [{flag, ?wxEXPAND}, {proportion,1}]),
@@ -80,7 +88,9 @@ process_trace(Parent, Default) ->
case wxDialog:showModal(Dialog) of
?wxID_OK ->
All = [{SendBox, send}, {RecBox, 'receive'},
- {FuncBox, functions}, {EventBox, events},
+ {FuncBox, functions}, {ArityBox, arity},
+ {EventBox, events}, {SchedBox, running_procs},
+ {ExitBox, exiting}, {GCBox, garbage_collection},
{{SpawnBox, SpwnAllRadio}, on_spawn},
{{SpawnBox,SpwnFirstRadio}, on_first_spawn},
{{LinkBox, LinkAllRadio}, on_link},
@@ -111,8 +121,10 @@ port_trace(Parent, Default) ->
check_box(RecBox, lists:member('receive', Default)),
EventBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace port events", []),
check_box(EventBox, lists:member(events, Default)),
+ SchedBox = wxCheckBox:new(Panel, ?wxID_ANY, "Trace scheduling of ports", []),
+ check_box(SchedBox, lists:member(running_ports, Default)),
- [wxSizer:add(OptsSz, CheckBox, []) || CheckBox <- [SendBox,RecBox,EventBox]],
+ [wxSizer:add(OptsSz, CheckBox, []) || CheckBox <- [SendBox,RecBox,EventBox,SchedBox]],
wxSizer:add(OptsSz, 150, -1),
wxPanel:setSizer(Panel, OptsSz),
@@ -125,7 +137,7 @@ port_trace(Parent, Default) ->
case wxDialog:showModal(Dialog) of
?wxID_OK ->
All = [{SendBox, send}, {RecBox, 'receive'},
- {EventBox, events}],
+ {EventBox, events}, {SchedBox, running_ports}],
Opts = [Id || {Tick, Id} <- All, wxCheckBox:getValue(Tick)],
wxDialog:destroy(Dialog),
lists:reverse(Opts);
diff --git a/lib/observer/src/ttb.erl b/lib/observer/src/ttb.erl
index e41f2c36fc..ac6c4572eb 100644
--- a/lib/observer/src/ttb.erl
+++ b/lib/observer/src/ttb.erl
@@ -1310,6 +1310,9 @@ ip_to_file(Trace, {shell_only, Fun} = State) ->
ip_to_file(Trace,{{file,File}, ShellOutput}) ->
Fun = dbg:trace_port(file,File), %File can be a filename or a wrap spec
Port = Fun(),
+ %% Just in case this is on the traced node,
+ %% make sure the port is not traced.
+ p(Port,clear),
%% Store the port so it can be properly closed
?MODULE ! {ip_to_file_trace_port, Port, self()},
receive {?MODULE,ok} -> ok end,