[cleanup] kill stats_mode option

Summary: In every place this was used except one, `debug_mode` is also used as a gate.

Reviewed By: jeremydubreil

Differential Revision: D6450913

fbshipit-source-id: 6a5716d
master
Sam Blackshear 7 years ago committed by Facebook Github Bot
parent 306a0a9182
commit adde940be4

@ -65,7 +65,7 @@ let print_legend () =
L.progress "legend:@." ; L.progress "legend:@." ;
L.progress " \"%s\" analyzing a file@\n" Config.log_analysis_file ; L.progress " \"%s\" analyzing a file@\n" Config.log_analysis_file ;
L.progress " \"%s\" analyzing a procedure@\n" Config.log_analysis_procedure ; L.progress " \"%s\" analyzing a procedure@\n" Config.log_analysis_procedure ;
if Config.stats_mode || Config.debug_mode then ( if Config.debug_mode then (
L.progress " \"%s\" analyzer crashed@\n" Config.log_analysis_crash ; L.progress " \"%s\" analyzer crashed@\n" Config.log_analysis_crash ;
L.progress " \"%s\" timeout: procedure analysis took too much time@\n" L.progress " \"%s\" timeout: procedure analysis took too much time@\n"
Config.log_analysis_wallclock_timeout ; Config.log_analysis_wallclock_timeout ;
@ -177,4 +177,3 @@ let register_perf_stats_report () =
let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json" in let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json" in
let stats_file = Filename.concat stats_dir stats_base in let stats_file = Filename.concat stats_dir stats_base in
PerfStats.register_report_at_exit stats_file PerfStats.register_report_at_exit stats_file

@ -999,7 +999,6 @@ and ( bo_debug
, print_logs , print_logs
, print_types , print_types
, reports_include_ml_loc , reports_include_ml_loc
, stats
, trace_error , trace_error
, write_html , write_html
, write_html_whitelist_regex , write_html_whitelist_regex
@ -1061,7 +1060,8 @@ and ( bo_debug
debug_level_linters := level debug_level_linters := level
in in
let debug = let debug =
CLOpt.mk_bool_group ~deprecated:["debug"] ~long:"debug" ~short:'g' ~in_help:all_generic_manuals CLOpt.mk_bool_group ~deprecated:["debug"; "-stats"] ~long:"debug" ~short:'g'
~in_help:all_generic_manuals
"Debug mode (also sets $(b,--debug-level 2), $(b,--developer-mode), $(b,--no-filtering), $(b,--print-buckets), $(b,--print-types), $(b,--reports-include-ml-loc), $(b,--no-only-cheap-debug), $(b,--trace-error), $(b,--write-dotty), $(b,--write-html))" "Debug mode (also sets $(b,--debug-level 2), $(b,--developer-mode), $(b,--no-filtering), $(b,--print-buckets), $(b,--print-types), $(b,--reports-include-ml-loc), $(b,--no-only-cheap-debug), $(b,--trace-error), $(b,--write-dotty), $(b,--write-html))"
~f:(fun debug -> ~f:(fun debug ->
if debug then set_debug_level 2 else set_debug_level 0 ; if debug then set_debug_level 2 else set_debug_level 0 ;
@ -1104,10 +1104,6 @@ and ( bo_debug
; (Run, manual_generic) ; (Run, manual_generic)
; (Report, manual_generic) ]) ; (Report, manual_generic) ])
"Also log messages to stdout and stderr" "Also log messages to stdout and stderr"
and stats =
CLOpt.mk_bool ~deprecated:["stats"] ~long:"stats" "Stats mode (debugging)" ~f:(fun stats ->
if stats then set_debug_level 1 else set_debug_level 0 ;
stats )
in in
let linters_developer_mode = let linters_developer_mode =
CLOpt.mk_bool_group ~long:"linters-developer-mode" CLOpt.mk_bool_group ~long:"linters-developer-mode"
@ -1136,7 +1132,6 @@ and ( bo_debug
, print_logs , print_logs
, print_types , print_types
, reports_include_ml_loc , reports_include_ml_loc
, stats
, trace_error , trace_error
, write_html , write_html
, write_html_whitelist_regex , write_html_whitelist_regex
@ -2655,8 +2650,6 @@ and stacktrace = !stacktrace
and stacktraces_dir = !stacktraces_dir and stacktraces_dir = !stacktraces_dir
and stats_mode = !stats
and stats_report = !stats_report and stats_report = !stats_report
and subtype_multirange = !subtype_multirange and subtype_multirange = !subtype_multirange

@ -642,8 +642,6 @@ val stacktrace : string option
val stacktraces_dir : string option val stacktraces_dir : string option
val stats_mode : bool
val stats_report : string option val stats_report : string option
val subtype_multirange : bool val subtype_multirange : bool

@ -191,7 +191,7 @@ let progressbar_file () = progress_bar Config.log_analysis_file
let progressbar_procedure () = progress_bar Config.log_analysis_procedure let progressbar_procedure () = progress_bar Config.log_analysis_procedure
let progressbar_timeout_event failure_kind = let progressbar_timeout_event failure_kind =
if Config.stats_mode || Config.debug_mode then if Config.debug_mode then
match failure_kind with match failure_kind with
| SymOp.FKtimeout -> | SymOp.FKtimeout ->
progress_bar Config.log_analysis_wallclock_timeout progress_bar Config.log_analysis_wallclock_timeout

@ -62,8 +62,8 @@ let do_source_file translation_unit_context ast =
Cfg.store_to_file ~source_file cfg_file cfg ; Cfg.store_to_file ~source_file cfg_file cfg ;
Tenv.sort_fields_tenv tenv ; Tenv.sort_fields_tenv tenv ;
Tenv.store_to_file tenv_file tenv ; Tenv.store_to_file tenv_file tenv ;
if Config.stats_mode then Cfg.check_cfg_connectedness cfg ; if Config.debug_mode then Cfg.check_cfg_connectedness cfg ;
if Config.stats_mode || Config.debug_mode || Config.testing_mode || Config.frontend_tests if Config.debug_mode || Config.testing_mode || Config.frontend_tests
|| Option.is_some Config.icfg_dotty_outfile || Option.is_some Config.icfg_dotty_outfile
then ( then (
Dotty.print_icfg_dotty source_file cfg ; Dotty.print_icfg_dotty source_file cfg ;
@ -71,4 +71,3 @@ let do_source_file translation_unit_context ast =
L.(debug Capture Verbose) "%a" Cfg.pp_proc_signatures cfg ; L.(debug Capture Verbose) "%a" Cfg.pp_proc_signatures cfg ;
(* NOTE: nothing should be written to source_dir after this *) (* NOTE: nothing should be written to source_dir after this *)
DB.mark_file_updated (DB.source_dir_to_string source_dir) DB.mark_file_updated (DB.source_dir_to_string source_dir)

@ -539,8 +539,7 @@ let mode_from_command_line =
let run_prologue mode = let run_prologue mode =
if CLOpt.is_originator then L.environment_info "%a@\n" Config.pp_version () ; if CLOpt.is_originator then L.environment_info "%a@\n" Config.pp_version () ;
if Config.debug_mode || Config.stats_mode then if Config.debug_mode then L.environment_info "Driver mode:@\n%a@." pp_mode mode ;
L.environment_info "Driver mode:@\n%a@." pp_mode mode ;
if Config.dump_duplicate_symbols then reset_duplicates_file () ; if Config.dump_duplicate_symbols then reset_duplicates_file () ;
(* infer might be called from a Makefile and itself uses `make` to run the analysis in parallel, (* infer might be called from a Makefile and itself uses `make` to run the analysis in parallel,
but cannot communicate with the parent make command. Since infer won't interfere with them but cannot communicate with the parent make command. Since infer won't interfere with them
@ -575,3 +574,4 @@ let read_config_changed_files () =
| Error error -> | Error error ->
L.external_error "Error reading the changed files index '%s': %s@." index error ; L.external_error "Error reading the changed files index '%s': %s@." index error ;
None None

@ -84,5 +84,4 @@ let compile compiler build_prog build_args =
let capture compiler ~prog ~args = let capture compiler ~prog ~args =
let verbose_out_file = compile compiler prog args in let verbose_out_file = compile compiler prog args in
if Config.analyzer <> Config.CompileOnly then JMain.from_verbose_out verbose_out_file ; if Config.analyzer <> Config.CompileOnly then JMain.from_verbose_out verbose_out_file ;
if not (Config.debug_mode || Config.stats_mode) then Unix.unlink verbose_out_file if not Config.debug_mode then Unix.unlink verbose_out_file

@ -151,7 +151,7 @@ let add_profile_to_pom_in_directory dir =
~f:(fun () -> Unix.rename ~src:saved_pom_path ~dst:maven_pom_path) ~f:(fun () -> Unix.rename ~src:saved_pom_path ~dst:maven_pom_path)
"restoring Maven's pom.xml to its original state" ; "restoring Maven's pom.xml to its original state" ;
Unix.rename ~src:infer_pom_path ~dst:maven_pom_path ; Unix.rename ~src:infer_pom_path ~dst:maven_pom_path ;
if Config.debug_mode || Config.stats_mode then if Config.debug_mode then
Epilogues.register Epilogues.register
~f:(fun () -> Unix.rename ~src:maven_pom_path ~dst:infer_pom_path) ~f:(fun () -> Unix.rename ~src:maven_pom_path ~dst:infer_pom_path)
"saving infer's pom.xml" "saving infer's pom.xml"
@ -178,4 +178,3 @@ let capture ~prog ~args =
"*** Maven command failed:@\n*** %s@\n*** %s@\n" "*** Maven command failed:@\n*** %s@\n*** %s@\n"
(String.concat ~sep:" " (prog :: capture_args)) (String.concat ~sep:" " (prog :: capture_args))
(Unix.Exit_or_signal.to_string_hum status) (Unix.Exit_or_signal.to_string_hum status)

Loading…
Cancel
Save