diff options
author | Björn-Egil Dahlberg <[email protected]> | 2010-05-25 14:19:59 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2010-06-03 14:54:21 +0200 |
commit | bf4e1025c3f70c4b18d898c61ba9bd8a4e952670 (patch) | |
tree | 781104608873d270a81a1bc8037ae09b04ca1e54 | |
parent | b2369c68b33344eb44544c0892cffb8acc658ffa (diff) | |
download | otp-bf4e1025c3f70c4b18d898c61ba9bd8a4e952670.tar.gz otp-bf4e1025c3f70c4b18d898c61ba9bd8a4e952670.tar.bz2 otp-bf4e1025c3f70c4b18d898c61ba9bd8a4e952670.zip |
Add bif tests to call time trace tests
-rw-r--r-- | erts/emulator/test/trace_call_time_SUITE.erl | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index d9f2050f7d..9ca3c9c319 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -228,20 +228,18 @@ scheduling(Config) when is_list(Config) -> ?line erlang:trace_pattern({?MODULE,loaded,1}, true, [call_time]), - ?line Pids = [setup() || _ <- lists:seq(1, F*Np)], - ?line T0 = now(), - ?line Res = execute(Pids, {?MODULE,loaded,[M]}), - ?line T1 = now(), - ?line Time = timer:now_diff(T1,T0), + ?line Pids = [setup() || _ <- lists:seq(1, F*Np)], + ?line {Ls,T1} = execute(Pids, {?MODULE,loaded,[M]}), ?line [Pid ! quit || Pid <- Pids], %% logic dictates that each process will get ~ 1/F of the schedulers time - ?line {call_time,CT} = erlang:trace_info({?MODULE,loaded,1}, call_time), + ?line {call_time, CT} = erlang:trace_info({?MODULE,loaded,1}, call_time), ?line lists:foreach(fun (Pid) -> - ?line ok = check_process_time(lists:keysearch(Pid, 1, CT), M, F, Time) + ?line ok = check_process_time(lists:keysearch(Pid, 1, CT), M, F, T1) end, Pids), + ?line P = erlang:trace_pattern({'_','_','_'}, false, [call_time]), ok. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -340,8 +338,17 @@ bif(Config) when is_list(Config) -> ?line Pid = setup(), ?line {L, T1} = execute(Pid, fun() -> with_bif(M) end), - ?line ok = check_trace_info({erlang, binary_to_term, 1}, [{Pid, M, 0, 0}], T1/2), - ?line ok = check_trace_info({erlang, term_to_binary, 1}, [{Pid, M, 0, 0}], T1/2), + ?line ok = check_trace_info({erlang, binary_to_term, 1}, [{Pid, M-1, 0, 0}], T1/2), + ?line ok = check_trace_info({erlang, term_to_binary, 1}, [{Pid, M-1, 0, 0}], T1/2), + + % disable term2binary + + ?line 2 = erlang:trace_pattern({erlang, term_to_binary, '_'}, false, [call_time]), + + ?line {L, T2} = execute(Pid, fun() -> with_bif(M) end), + + ?line ok = check_trace_info({erlang, binary_to_term, 1}, [{Pid, M*2 - 2, 0, 0}], T1/2 + T2), + ?line ok = check_trace_info({erlang, term_to_binary, 1}, false, none), %% ?line P = erlang:trace_pattern({'_','_','_'}, false, [call_time]), @@ -366,8 +373,8 @@ nif(Config) when is_list(Config) -> % the nif is called M - 1 times, the last time the function with 'with_nif' % returns ok and does not call the nif. - ?line ok = check_trace_info({?MODULE, nif_dec, 1}, [{Pid, M-1, 0, 0}], T1/2), - ?line ok = check_trace_info({?MODULE, with_nif, 1}, [{Pid, M, 0, 0}], T1/2), + ?line ok = check_trace_info({?MODULE, nif_dec, 1}, [{Pid, M-1, 0, 0}], T1/5*4), + ?line ok = check_trace_info({?MODULE, with_nif, 1}, [{Pid, M, 0, 0}], T1/5), %% ?line P = erlang:trace_pattern({'_','_','_'}, false, [call_time]), |