diff --git a/infer/src/backend/InferAnalyze.ml b/infer/src/backend/InferAnalyze.ml index b06b534dd..66475b327 100644 --- a/infer/src/backend/InferAnalyze.ml +++ b/infer/src/backend/InferAnalyze.ml @@ -65,7 +65,7 @@ let print_legend () = L.progress "legend:@." ; L.progress " \"%s\" analyzing a file@\n" Config.log_analysis_file ; 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\" timeout: procedure analysis took too much time@\n" 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_file = Filename.concat stats_dir stats_base in PerfStats.register_report_at_exit stats_file - diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 933935057..5b8123e1b 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -999,7 +999,6 @@ and ( bo_debug , print_logs , print_types , reports_include_ml_loc - , stats , trace_error , write_html , write_html_whitelist_regex @@ -1061,7 +1060,8 @@ and ( bo_debug debug_level_linters := level in 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))" ~f:(fun debug -> if debug then set_debug_level 2 else set_debug_level 0 ; @@ -1104,10 +1104,6 @@ and ( bo_debug ; (Run, manual_generic) ; (Report, manual_generic) ]) "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 let linters_developer_mode = CLOpt.mk_bool_group ~long:"linters-developer-mode" @@ -1136,7 +1132,6 @@ and ( bo_debug , print_logs , print_types , reports_include_ml_loc - , stats , trace_error , write_html , write_html_whitelist_regex @@ -2655,8 +2650,6 @@ and stacktrace = !stacktrace and stacktraces_dir = !stacktraces_dir -and stats_mode = !stats - and stats_report = !stats_report and subtype_multirange = !subtype_multirange diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 294d7e159..4cd232681 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -642,8 +642,6 @@ val stacktrace : string option val stacktraces_dir : string option -val stats_mode : bool - val stats_report : string option val subtype_multirange : bool diff --git a/infer/src/base/Logging.ml b/infer/src/base/Logging.ml index e743aada5..749b59b6e 100644 --- a/infer/src/base/Logging.ml +++ b/infer/src/base/Logging.ml @@ -191,7 +191,7 @@ let progressbar_file () = progress_bar Config.log_analysis_file let progressbar_procedure () = progress_bar Config.log_analysis_procedure let progressbar_timeout_event failure_kind = - if Config.stats_mode || Config.debug_mode then + if Config.debug_mode then match failure_kind with | SymOp.FKtimeout -> progress_bar Config.log_analysis_wallclock_timeout diff --git a/infer/src/clang/cFrontend.ml b/infer/src/clang/cFrontend.ml index 9327a0613..66deacb8d 100644 --- a/infer/src/clang/cFrontend.ml +++ b/infer/src/clang/cFrontend.ml @@ -62,8 +62,8 @@ let do_source_file translation_unit_context ast = Cfg.store_to_file ~source_file cfg_file cfg ; Tenv.sort_fields_tenv tenv ; Tenv.store_to_file tenv_file tenv ; - if Config.stats_mode then Cfg.check_cfg_connectedness cfg ; - if Config.stats_mode || Config.debug_mode || Config.testing_mode || Config.frontend_tests + if Config.debug_mode then Cfg.check_cfg_connectedness cfg ; + if Config.debug_mode || Config.testing_mode || Config.frontend_tests || Option.is_some Config.icfg_dotty_outfile then ( 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 ; (* NOTE: nothing should be written to source_dir after this *) DB.mark_file_updated (DB.source_dir_to_string source_dir) - diff --git a/infer/src/integration/Driver.ml b/infer/src/integration/Driver.ml index 5f3e2af32..9ed81406f 100644 --- a/infer/src/integration/Driver.ml +++ b/infer/src/integration/Driver.ml @@ -539,8 +539,7 @@ let mode_from_command_line = let run_prologue mode = if CLOpt.is_originator then L.environment_info "%a@\n" Config.pp_version () ; - if Config.debug_mode || Config.stats_mode then - L.environment_info "Driver mode:@\n%a@." pp_mode mode ; + if Config.debug_mode then L.environment_info "Driver mode:@\n%a@." pp_mode mode ; 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, 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 -> L.external_error "Error reading the changed files index '%s': %s@." index error ; None + diff --git a/infer/src/integration/Javac.ml b/infer/src/integration/Javac.ml index c6fa3dda4..2bb1f3912 100644 --- a/infer/src/integration/Javac.ml +++ b/infer/src/integration/Javac.ml @@ -84,5 +84,4 @@ let compile compiler build_prog build_args = let capture compiler ~prog ~args = let verbose_out_file = compile compiler prog args in 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 diff --git a/infer/src/integration/Maven.ml b/infer/src/integration/Maven.ml index 9b8638558..4fb7b7489 100644 --- a/infer/src/integration/Maven.ml +++ b/infer/src/integration/Maven.ml @@ -151,7 +151,7 @@ let add_profile_to_pom_in_directory dir = ~f:(fun () -> Unix.rename ~src:saved_pom_path ~dst:maven_pom_path) "restoring Maven's pom.xml to its original state" ; 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 ~f:(fun () -> Unix.rename ~src:maven_pom_path ~dst:infer_pom_path) "saving infer's pom.xml" @@ -178,4 +178,3 @@ let capture ~prog ~args = "*** Maven command failed:@\n*** %s@\n*** %s@\n" (String.concat ~sep:" " (prog :: capture_args)) (Unix.Exit_or_signal.to_string_hum status) -