aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-04-14 16:46:31 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-04-14 16:46:31 +0200
commit0fc3412387a889663f55515f123f1168e8f66be2 (patch)
tree4a80453d9b772cb6155bb0cbdd860a3b21b04921 /erts/emulator
parent3e6f813222057941515df9cdb1f5d89ac3dd9cf5 (diff)
downloadotp-0fc3412387a889663f55515f123f1168e8f66be2.tar.gz
otp-0fc3412387a889663f55515f123f1168e8f66be2.tar.bz2
otp-0fc3412387a889663f55515f123f1168e8f66be2.zip
erts: Enhance system_profile tests
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/test/system_profile_SUITE.erl32
1 files changed, 30 insertions, 2 deletions
diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl
index a56b394765..2e359b11ce 100644
--- a/erts/emulator/test/system_profile_SUITE.erl
+++ b/erts/emulator/test/system_profile_SUITE.erl
@@ -27,7 +27,7 @@
system_profile_on_and_off/1,
runnable_procs/1, runnable_ports/1,
dont_profile_profiler/1,
- scheduler/1]).
+ scheduler/1, sane_location/1]).
-export([profiler_process/1, ring_loop/1, port_echo_start/0,
list_load/0, run_load/2]).
@@ -40,7 +40,8 @@ suite() ->
all() ->
[system_profile_on_and_off, runnable_procs,
- runnable_ports, scheduler, dont_profile_profiler].
+ runnable_ports, scheduler, dont_profile_profiler,
+ sane_location].
%% No specification clause needed for an init function in a conf case!!!
@@ -183,6 +184,33 @@ dont_profile_profiler(Config) when is_list(Config) ->
exit(Pid,kill),
ok.
+%% Check sane location (of exits)
+sane_location(Config) when is_list(Config) ->
+ Check = spawn_link(fun() -> flush_sane_location() end),
+ erlang:system_profile(Check, [runnable_procs]),
+ Me = self(),
+ Pids = [spawn_link(fun() -> wat(Me) end) || _ <- lists:seq(1,100)],
+ [receive {Pid,ok} -> ok end || Pid <- Pids],
+ Check ! {Me, done},
+ receive {Check,ok} -> ok end,
+ ok.
+
+wat(Pid) ->
+ Pid ! {self(), ok}.
+
+flush_sane_location() ->
+ receive
+ {profile,_,_,{M,F,A},_} when is_atom(M), is_atom(F),
+ is_integer(A) ->
+ flush_sane_location();
+ {profile,_,_,0,_} ->
+ flush_sane_location();
+ {Pid,done} when is_pid(Pid) ->
+ Pid ! {self(), ok};
+ M ->
+ ct:fail({badness,M})
+ end.
+
%%% Check scheduler profiling