33
34
%% Default timetrap timeout (set in init_per_testcase)
34
-define(default_timeout, ?t:minutes(1)).
35
-define(default_timeout, ?t:minutes(2)).
36
37
init_per_suite(Config) when is_list(Config) ->
89
["Percept profile test."];
89
["Percept analyze test."];
90
90
analyze(Config) when is_list(Config) ->
91
92
Path = ?config(data_dir, Config),
92
93
File = filename:join([Path,"profile_test.dat"]),
93
?line ok = percept:analyze(File),
95
?line ok = percept:analyze(File),
97
Secs = timer:now_diff(T1,T0)/1000000,
98
io:format("percept:analyze/1 took ~.2f s.~n", [Secs]),
99
?line {stopped, _} = percept_db:stop(),
100
print_remainers(remainers(Begin, processes())),
103
analyze_dist(suite) ->
106
["Percept analyze distribution test."];
107
analyze_dist(Config) when is_list(Config) ->
109
Path = ?config(data_dir, Config),
110
File = filename:join([Path,"ipc-dist.dat"]),
112
?line ok = percept:analyze(File),
114
Secs = timer:now_diff(T1,T0)/1000000,
115
io:format("percept:analyze/1 took ~.2f s.~n", [Secs]),
116
?line {stopped, _} = percept_db:stop(),
117
print_remainers(remainers(Begin, processes())),
97
120
%%----------------------------------------------------------------------
101
124
%%----------------------------------------------------------------------
103
126
%%----------------------------------------------------------------------
128
print_remainers([]) -> ok;
129
print_remainers([Pid|Pids]) ->
130
io:format("[Pid ~p] [Entry ~p] [Name ~p]~n", [
132
erlang:process_info(Pid, initial_call),
133
erlang:process_info(Pid, registered_name)
135
print_remainers(Pids).
137
remainers(Begin, End) -> remainers(Begin, End, []).
138
remainers(_, [], Out) -> lists:reverse(Out);
139
remainers(Begin, [Pid|End], Out) ->
140
case lists:member(Pid, Begin) of
141
true -> remainers(Begin, End, Out);
142
false -> remainers(Begin, End, [Pid|Out])