aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/test/dbg_SUITE.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-02-23 17:09:25 +0100
committerLukas Larsson <[email protected]>2016-04-15 15:07:10 +0200
commit48ab07fe347d547b6985cf3e2fc7126277d5d7dd (patch)
tree09b7d7f45cfa5ee3dc2d87da1c84d639c7c117d9 /lib/runtime_tools/test/dbg_SUITE.erl
parentecd20cf55ffcc45632825863ea8f0c7442553a0d (diff)
downloadotp-48ab07fe347d547b6985cf3e2fc7126277d5d7dd.tar.gz
otp-48ab07fe347d547b6985cf3e2fc7126277d5d7dd.tar.bz2
otp-48ab07fe347d547b6985cf3e2fc7126277d5d7dd.zip
runtime_tools: Update dbg to work with tracing on ports
OTP-13500
Diffstat (limited to 'lib/runtime_tools/test/dbg_SUITE.erl')
-rw-r--r--lib/runtime_tools/test/dbg_SUITE.erl33
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl
index d40efcafef..458c6a2dea 100644
--- a/lib/runtime_tools/test/dbg_SUITE.erl
+++ b/lib/runtime_tools/test/dbg_SUITE.erl
@@ -22,7 +22,7 @@
%% Test functions
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
- big/1, tiny/1, simple/1, message/1, distributed/1,
+ big/1, tiny/1, simple/1, message/1, distributed/1, port/1,
ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1,
ip_port_busy/1, wrap_port/1, wrap_port_time/1,
with_seq_trace/1, dead_suspend/1, local_trace/1,
@@ -45,7 +45,7 @@ end_per_testcase(_Case, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [big, tiny, simple, message, distributed, ip_port,
+ [big, tiny, simple, message, distributed, port, ip_port,
file_port, file_port2, file_port_schedfix, ip_port_busy,
wrap_port, wrap_port_time, with_seq_trace, dead_suspend,
local_trace, saved_patterns, tracer_exit_on_stop].
@@ -272,6 +272,35 @@ local_trace(Config) when is_list(Config) ->
end,
ok.
+port(suite) ->
+ [];
+port(doc) ->
+ ["Test that tracing on port works"];
+port(Config) when is_list(Config) ->
+ try
+ S = self(),
+ start(),
+ TestFile = filename:join(proplists:get_value(priv_dir, Config),"port_test"),
+ Fun = dbg:trace_port(file, TestFile),
+
+ %% Do a run to get rid of all extra port operations
+ port_close(Fun()),
+
+ dbg:p(new,ports),
+ Port = Fun(),
+ port_close(Port),
+ stop(),
+
+ TraceFileDrv = list_to_atom(lists:flatten(["trace_file_drv n ",TestFile])),
+ [{trace,Port,open,S,TraceFileDrv},
+ {trace,Port,getting_linked,S},
+ {trace,Port,closed,normal},
+ {trace,Port,unlink,S}] = flush()
+ after
+ dbg:stop()
+ end,
+ ok.
+
saved_patterns(suite) ->
[];
saved_patterns(doc) ->