[logging] Always log PerfStats to EventLogger

Summary:
- PerformanceStats rows will be logged to EventLogger regardless of whether Infer is in developer mode
- PerformanceStats files will still not be created unless Infer is in developer mode

Reviewed By: dulmarod

Differential Revision: D7169403

fbshipit-source-id: 85bd7de
master
Varun Arora 7 years ago committed by Facebook Github Bot
parent 37720e1bbf
commit 5d6951a545

@ -977,7 +977,7 @@ let main ~report_json =
; (Stats, init_stats_format_list ()) ; (Stats, init_stats_format_list ())
; (Summary, []) ] ; (Summary, []) ]
in in
if Config.developer_mode then register_perf_stats_report () ; register_perf_stats_report () ;
init_files formats_by_report_kind ; init_files formats_by_report_kind ;
match Config.from_json_report with match Config.from_json_report with
| Some fname -> | Some fname ->

@ -166,6 +166,8 @@ let report_at_exit file source_file stats_type () =
let stats, stats_event = stats source_file stats_type in let stats, stats_event = stats source_file stats_type in
let json_stats = to_json stats in let json_stats = to_json stats in
EventLogger.log stats_event ; EventLogger.log stats_event ;
(* We always log to EventLogger, but json files are unnecessary to log outside of developer mode *)
if Config.developer_mode then
try try
Unix.mkdir_p (Filename.dirname file) ; Unix.mkdir_p (Filename.dirname file) ;
(* the same report may be registered across different infer processes *) (* the same report may be registered across different infer processes *)

@ -128,7 +128,7 @@ let () =
F.fprintf fmt "of cluster %s" (Filename.basename cluster) F.fprintf fmt "of cluster %s" (Filename.basename cluster)
in in
L.environment_info "Starting analysis %a" pp_cluster_opt Config.cluster_cmdline ; L.environment_info "Starting analysis %a" pp_cluster_opt Config.cluster_cmdline ;
if Config.developer_mode then InferAnalyze.register_perf_stats_report () ; InferAnalyze.register_perf_stats_report () ;
Driver.analyze_and_report Analyze ~changed_files:(Driver.read_config_changed_files ()) Driver.analyze_and_report Analyze ~changed_files:(Driver.read_config_changed_files ())
| Report -> | Report ->
InferPrint.main ~report_json:None InferPrint.main ~report_json:None

@ -32,8 +32,8 @@ let register_perf_stats_report source_file =
let init_global_state_for_capture_and_linters source_file = let init_global_state_for_capture_and_linters source_file =
L.(debug Capture Medium) "Processing %s" (Filename.basename (SourceFile.to_abs_path source_file)) ; L.(debug Capture Medium) "Processing %s" (Filename.basename (SourceFile.to_abs_path source_file)) ;
if Config.developer_mode then register_perf_stats_report source_file ;
Language.curr_language := Language.Clang ; Language.curr_language := Language.Clang ;
register_perf_stats_report source_file ;
if Config.capture then DB.Results_dir.init source_file ; if Config.capture then DB.Results_dir.init source_file ;
CFrontend_config.reset_global_state () CFrontend_config.reset_global_state ()

@ -542,7 +542,7 @@ let run_prologue mode =
anyway, pretend that we are not called from another make to prevent make falling back to a anyway, pretend that we are not called from another make to prevent make falling back to a
mono-threaded execution. *) mono-threaded execution. *)
Unix.unsetenv "MAKEFLAGS" ; Unix.unsetenv "MAKEFLAGS" ;
if Config.developer_mode then register_perf_stats_report () ; register_perf_stats_report () ;
() ()

@ -21,8 +21,8 @@ let register_perf_stats_report source_file =
let init_global_state source_file = let init_global_state source_file =
if Config.developer_mode then register_perf_stats_report source_file ;
Language.curr_language := Language.Java ; Language.curr_language := Language.Java ;
register_perf_stats_report source_file ;
DB.Results_dir.init source_file ; DB.Results_dir.init source_file ;
Ident.NameGenerator.reset () ; Ident.NameGenerator.reset () ;
JContext.reset_exn_node_table () JContext.reset_exn_node_table ()

Loading…
Cancel
Save