@ -62,6 +62,11 @@ let clean_compilation_command mode =
None
None
let register_perf_stats_report stats_type =
let rtime_span , initial_times = ( Mtime_clock . counter () , Unix . times () ) in
PerfStats . register_report ( PerfStats . Time ( rtime_span , initial_times ) ) stats_type
(* Clean up the results dir to select only what's relevant to go in the Buck cache. In particular,
(* Clean up the results dir to select only what's relevant to go in the Buck cache. In particular,
get rid of non - deterministic outputs . * )
get rid of non - deterministic outputs . * )
let clean_results_dir () =
let clean_results_dir () =
@ -208,6 +213,7 @@ let capture ~changed_files mode =
(* pretend prog is the root directory of the project *)
(* pretend prog is the root directory of the project *)
PythonMain . go args
PythonMain . go args
| PythonCapture ( build_system , build_cmd ) ->
| PythonCapture ( build_system , build_cmd ) ->
register_perf_stats_report PerfStats . TotalFrontend ;
L . progress " Capturing in %s mode...@. " ( Config . string_of_build_system build_system ) ;
L . progress " Capturing in %s mode...@. " ( Config . string_of_build_system build_system ) ;
let in_buck_mode = Config . equal_build_system build_system BBuck in
let in_buck_mode = Config . equal_build_system build_system BBuck in
let infer_py = Config . lib_dir ^/ " python " ^/ " infer.py " in
let infer_py = Config . lib_dir ^/ " python " ^/ " infer.py " in
@ -282,7 +288,8 @@ let capture ~changed_files mode =
Config . print_usage_exit ()
Config . print_usage_exit ()
| status ->
| status ->
command_error_handling ~ always_die : true ~ prog : infer_py ~ args status )
command_error_handling ~ always_die : true ~ prog : infer_py ~ args status )
()
() ;
PerfStats . get_reporter PerfStats . TotalFrontend ()
| XcodeXcpretty ( prog , args ) ->
| XcodeXcpretty ( prog , args ) ->
L . progress " Capturing using xcodebuild and xcpretty...@. " ;
L . progress " Capturing using xcodebuild and xcpretty...@. " ;
check_xcpretty () ;
check_xcpretty () ;
@ -312,9 +319,11 @@ let run_parallel_analysis ~changed_files : unit =
let execute_analyze ~ changed_files =
let execute_analyze ~ changed_files =
register_perf_stats_report PerfStats . TotalBackend ;
if Int . equal Config . jobs 1 | | Config . cluster_cmdline < > None then
if Int . equal Config . jobs 1 | | Config . cluster_cmdline < > None then
InferAnalyze . main ~ changed_files ~ makefile : " "
InferAnalyze . main ~ changed_files ~ makefile : " "
else run_parallel_analysis ~ changed_files
else run_parallel_analysis ~ changed_files ;
PerfStats . get_reporter PerfStats . TotalBackend ()
let report ? ( suppress_console = false ) () =
let report ? ( suppress_console = false ) () =
@ -528,11 +537,6 @@ let mode_from_command_line =
mode_of_build_command ( List . rev Config . rest ) )
mode_of_build_command ( List . rev Config . rest ) )
let register_perf_stats_report stats_type =
let rtime_span , initial_times = ( Mtime_clock . counter () , Unix . times () ) in
PerfStats . register_report ( PerfStats . Time ( rtime_span , initial_times ) ) stats_type
let run_prologue mode =
let run_prologue mode =
if CLOpt . is_originator then (
if CLOpt . is_originator then (
L . environment_info " %a@ \n " Config . pp_version () ;
L . environment_info " %a@ \n " Config . pp_version () ;