diff options
author | Stavros Aronis <[email protected]> | 2012-03-22 10:21:18 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2012-05-21 15:31:22 +0200 |
commit | 4e1ed3a5666c13d442759e710d9d08280362c0bb (patch) | |
tree | ef5a7f2385abe5b9c56b45a7e275347d07685217 /lib/dialyzer/src | |
parent | 24c2c72cab2c282eb17c8ac97c832106ecaf4ed8 (diff) | |
download | otp-4e1ed3a5666c13d442759e710d9d08280362c0bb.tar.gz otp-4e1ed3a5666c13d442759e710d9d08280362c0bb.tar.bz2 otp-4e1ed3a5666c13d442759e710d9d08280362c0bb.zip |
Relocate start and stop of timing server
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r-- | lib/dialyzer/src/dialyzer.hrl | 1 | ||||
-rw-r--r-- | lib/dialyzer/src/dialyzer_analysis_callgraph.erl | 4 | ||||
-rw-r--r-- | lib/dialyzer/src/dialyzer_cl.erl | 5 | ||||
-rw-r--r-- | lib/dialyzer/src/dialyzer_timing.erl | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/dialyzer/src/dialyzer.hrl b/lib/dialyzer/src/dialyzer.hrl index f282bbf73c..ebfc6b9731 100644 --- a/lib/dialyzer/src/dialyzer.hrl +++ b/lib/dialyzer/src/dialyzer.hrl @@ -127,6 +127,7 @@ use_contracts = true :: boolean(), race_detection = false :: boolean(), behaviours_chk = false :: boolean(), + timing = false :: boolean(), callgraph_file = "" :: file:filename()}). -record(options, {files = [] :: [file:filename()], diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index 67c5b3241d..641b7eb22a 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -64,12 +64,14 @@ -spec start(pid(), [dial_warn_tag()], #analysis{}) -> 'ok'. start(Parent, LegalWarnings, Analysis) -> + dialyzer_timing:init(Analysis#analysis.timing), RacesOn = ordsets:is_element(?WARN_RACE_CONDITION, LegalWarnings), Analysis0 = Analysis#analysis{race_detection = RacesOn}, Analysis1 = expand_files(Analysis0), Analysis2 = run_analysis(Analysis1), State = #server_state{parent = Parent, legal_warnings = LegalWarnings}, - loop(State, Analysis2, none). + loop(State, Analysis2, none), + dialyzer_timing:stop(). run_analysis(Analysis) -> Self = self(), diff --git a/lib/dialyzer/src/dialyzer_cl.erl b/lib/dialyzer/src/dialyzer_cl.erl index 482f428e02..5d253e77fa 100644 --- a/lib/dialyzer/src/dialyzer_cl.erl +++ b/lib/dialyzer/src/dialyzer_cl.erl @@ -394,16 +394,15 @@ do_analysis(Files, Options, Plt, PltInfo) -> defines = Options#options.defines, include_dirs = Options#options.include_dirs, files = Files, - start_from = Options#options.from, + start_from = Options#options.from, + timing = Options#options.timing, plt = Plt, use_contracts = Options#options.use_contracts, callgraph_file = Options#options.callgraph_file}, State3 = start_analysis(State2, InitAnalysis), {T1, _} = statistics(wall_clock), - ok = dialyzer_timing:init(Options#options.timing), Return = cl_loop(State3), {T2, _} = statistics(wall_clock), - ok = dialyzer_timing:stop(), report_elapsed_time(T1, T2, Options), Return. diff --git a/lib/dialyzer/src/dialyzer_timing.erl b/lib/dialyzer/src/dialyzer_timing.erl index c2a7b3ecf8..d5e6d1476d 100644 --- a/lib/dialyzer/src/dialyzer_timing.erl +++ b/lib/dialyzer/src/dialyzer_timing.erl @@ -32,10 +32,6 @@ init(Active) -> Pid = spawn_link(fun() -> loop_init(Active) end), - case whereis(?MODULE) of - undefined -> ok; - _ -> unregister(?MODULE) - end, register(?MODULE, Pid), ok. @@ -72,6 +68,8 @@ loop(LastNow, Size, Unit) -> loop(LastNow, NewSize, NewUnit); {Pid, stop, Now} -> io:format(" ~-9s (+~5.2fs)\n", ["",diff(Now, LastNow)]), + Pid ! ok; + {Pid, stop} -> Pid ! ok end. |